File tree Expand file tree Collapse file tree 1 file changed +3
-15
lines changed
Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments