diff --git a/src/npm-fastui/src/events.ts b/src/npm-fastui/src/events.ts index b1289725..6ac54172 100644 --- a/src/npm-fastui/src/events.ts +++ b/src/npm-fastui/src/events.ts @@ -89,6 +89,11 @@ interface EventDetails { } export function usePageEventListen(event?: PageEvent, initialContext: ContextType | null = null): EventDetails { + if (initialContext === null) { + if (event?.context !== null) { + initialContext = event?.context! + } + } const [eventContext, setEventContext] = useState(initialContext) const [fireId, setFireId] = useState(null)