Fix wrong hook (#4295)

* fix: Typo in variable name.

* fix: Using existing hook constant.

---------

Co-authored-by: Benedikt Bartscher <bb@senbax.de>
This commit is contained in:
abulvenz 2024-11-04 23:20:02 +00:00 committed by GitHub
parent 1122cbf0b1
commit bb903b605a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,7 +15,7 @@ from reflex.components.el.elements.forms import Input
from reflex.components.radix.themes.layout.box import Box from reflex.components.radix.themes.layout.box import Box
from reflex.config import environment from reflex.config import environment
from reflex.constants import Dirs from reflex.constants import Dirs
from reflex.constants.compiler import Imports from reflex.constants.compiler import Hooks, Imports
from reflex.event import ( from reflex.event import (
CallableEventSpec, CallableEventSpec,
EventChain, EventChain,
@ -285,20 +285,18 @@ class Upload(MemoizationLeaf):
format.to_camel_case(key): value for key, value in upload_props.items() format.to_camel_case(key): value for key, value in upload_props.items()
} }
use_dropzone_arguements = { use_dropzone_arguments = {
"onDrop": event_var, "onDrop": event_var,
**upload_props, **upload_props,
} }
left_side = f"const {{getRootProps: {root_props_unique_name}, getInputProps: {input_props_unique_name}}} " left_side = f"const {{getRootProps: {root_props_unique_name}, getInputProps: {input_props_unique_name}}} "
right_side = f"useDropzone({str(Var.create(use_dropzone_arguements))})" right_side = f"useDropzone({str(Var.create(use_dropzone_arguments))})"
var_data = VarData.merge( var_data = VarData.merge(
VarData( VarData(
imports=Imports.EVENTS, imports=Imports.EVENTS,
hooks={ hooks={Hooks.EVENTS: None},
"const [addEvents, connectError] = useContext(EventLoopContext);": None
},
), ),
event_var._get_all_var_data(), event_var._get_all_var_data(),
VarData( VarData(