Skip to content

Commit 5ce5c32

Browse files
committed
Update types
1 parent 258c4de commit 5ce5c32

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/reactpy/core/layout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async def deliver(self, event: LayoutEventMessage | dict[str, Any]) -> None:
118118
# we just ignore the event.
119119
handler = self._event_handlers.get(event["target"])
120120

121-
if handler is not None:
121+
if handler is not None and not isinstance(handler, str):
122122
try:
123123
await handler.function(event["data"])
124124
except Exception:

src/reactpy/core/vdom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def separate_attributes_and_event_handlers(
219219
_event_handlers: dict[str, EventHandlerType | str] = {}
220220

221221
for k, v in attributes.items():
222-
handler: EventHandlerType
222+
handler: EventHandlerType | str
223223

224224
if callable(v):
225225
handler = EventHandler(to_event_handler_function(v))

0 commit comments

Comments
 (0)