1
0
Эх сурвалжийг харах

Import event constructor in custom components (#249)

Nikhil Rao 2 жил өмнө
parent
commit
98e9edd98a

+ 4 - 1
pynecone/compiler/compiler.py

@@ -81,7 +81,10 @@ def _compile_components(components: Set[CustomComponent]) -> str:
     Returns:
         The compiled components.
     """
-    imports = {"react": {"memo"}}
+    imports = {
+        "react": {"memo"},
+        f"/{constants.STATE_PATH}": {"E"},
+    }
     component_defs = []
 
     # Compile each component.