Skip to content

Commit 2836e49

Browse files
author
王泽龙
committed
[fix] initialContext is assigned the value of event.context
1 parent 5d9d604 commit 2836e49

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/npm-fastui/src/events.ts

+5
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ interface EventDetails {
8989
}
9090

9191
export function usePageEventListen(event?: PageEvent, initialContext: ContextType | null = null): EventDetails {
92+
if (initialContext === null) {
93+
if (event?.context !== null) {
94+
initialContext = event?.context!
95+
}
96+
}
9297
const [eventContext, setEventContext] = useState<ContextType | null>(initialContext)
9398
const [fireId, setFireId] = useState<string | null>(null)
9499

0 commit comments

Comments
 (0)