Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] initialContext is assigned the value of event.context
Browse files Browse the repository at this point in the history
王泽龙 committed Sep 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 5d9d604 commit 2836e49
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/npm-fastui/src/events.ts
Original file line number Diff line number Diff line change
@@ -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<ContextType | null>(initialContext)
const [fireId, setFireId] = useState<string | null>(null)

0 comments on commit 2836e49

Please sign in to comment.