Skip to content

Commit fa0eff7

Browse files
committed
simplify render checks
1 parent c11d022 commit fa0eff7

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

reflex/compiler/templates.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ class _RenderUtils:
5757
"""
5858

5959
@staticmethod
60-
def render(component: Any) -> str:
61-
if not isinstance(component, Mapping):
62-
return str(component)
63-
60+
def render(component: Mapping[str, Any] | str) -> str:
61+
if isinstance(component, str):
62+
return component
6463
if "iterable" in component:
6564
return _RenderUtils.render_iterable_tag(component)
6665
if component.get("name") == "match":
@@ -71,17 +70,6 @@ def render(component: Any) -> str:
7170
return contents
7271
return _RenderUtils.render_tag(component)
7372

74-
@staticmethod
75-
def render_self_close_tag(component: Mapping[str, Any]) -> str:
76-
if component.get("name"):
77-
name = component["name"]
78-
props = f"{{{','.join(component['props'])}}}"
79-
contents = component.get("contents", "")
80-
return f"jsx({name},{props},{contents})"
81-
if component.get("contents"):
82-
return component["contents"]
83-
return '""'
84-
8573
@staticmethod
8674
def render_tag(component: Mapping[str, Any]) -> str:
8775
name = component.get("name") or "Fragment"

0 commit comments

Comments
 (0)