File tree Expand file tree Collapse file tree 1 file changed +16
-18
lines changed
Expand file tree Collapse file tree 1 file changed +16
-18
lines changed Original file line number Diff line number Diff line change 2222
2323import reflex .state
2424from reflex import constants
25- from reflex import constants
2625from reflex .compiler .templates import stateful_component_template
2726from reflex .components .core .breakpoints import Breakpoints
2827from reflex .components .dynamic import load_dynamic_serializer
@@ -2243,24 +2242,23 @@ def wrapper(*children, **props) -> CustomComponent:
22432242
22442243 # Register this component so it can be compiled.
22452244 dummy_component = _register_custom_component (component_fn )
2246- object . __setattr__ (
2247- wrapper ,
2248- "_as_var" ,
2249- lambda : Var (
2250- f"jsx( { dummy_component . tag } )" ,
2251- _var_type = Component ,
2252- _var_data = VarData (
2253- imports = {
2254- f"$/ { constants . Dirs . UTILS } /components" : [
2255- ImportVar (tag = dummy_component . tag )
2256- ],
2257- "@emotion/react" : [
2258- ImportVar ( tag = "jsx" ) ,
2259- ],
2260- }
2245+ if tag := dummy_component . tag :
2246+ object . __setattr__ (
2247+ wrapper ,
2248+ "_as_var" ,
2249+ lambda : Var (
2250+ tag ,
2251+ _var_type = type [ Component ],
2252+ _var_data = VarData (
2253+ imports = {
2254+ f"$/ { constants . Dirs . UTILS } /components" : [ ImportVar (tag = tag )],
2255+ "@emotion/react" : [
2256+ ImportVar ( tag = "jsx" ),
2257+ ] ,
2258+ }
2259+ ),
22612260 ),
2262- ),
2263- )
2261+ )
22642262
22652263 return wrapper
22662264
You can’t perform that action at this time.
0 commit comments