MCPcopy Create free account
hub / github.com/dot-agent/nextpy / render

Method render

nextpy/frontend/components/component.py:625–640  ·  view source on GitHub ↗

Render the component. Returns: The dictionary for template of component.

(self)

Source from the content-addressed store, hash-verified

623 return {"css": Var.create(format_as_emotion(self.style))}
624
625 def render(self) -> Dict:
626 """Render the component.
627
628 Returns:
629 The dictionary for template of component.
630 """
631 tag = self._render()
632 rendered_dict = dict(
633 tag.set(
634 children=[child.render() for child in self.children],
635 contents=str(tag.contents),
636 props=tag.format_props(),
637 ),
638 autofocus=self.autofocus,
639 )
640 return rendered_dict
641
642 def _validate_component_children(self, children: List[Component]):
643 """Validate the children components.

Callers 3

__repr__Method · 0.95
_get_tag_nameMethod · 0.45
_render_stateful_codeMethod · 0.45

Calls 3

_renderMethod · 0.95
format_propsMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected