Explorar el Código

Import event constructor in custom components (#249)

Nikhil Rao hace 2 años
padre
commit
98e9edd98a
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      pynecone/compiler/compiler.py

+ 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.