Browse Source

Import event constructor in custom components (#249)

Nikhil Rao 2 years ago
parent
commit
98e9edd98a
1 changed files with 4 additions and 1 deletions
  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:
     Returns:
         The compiled components.
         The compiled components.
     """
     """
-    imports = {"react": {"memo"}}
+    imports = {
+        "react": {"memo"},
+        f"/{constants.STATE_PATH}": {"E"},
+    }
     component_defs = []
     component_defs = []
 
 
     # Compile each component.
     # Compile each component.