Skip to content
Discussion options

You must be logged in to vote

Context is available in the body of a component, but is not available in things that run outside the component tree, like event listeners. You can use_context in the body of the component, and then move it into the event listener, instead.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mahdi739
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4436 on November 06, 2025 13:30.