Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): use scope in useAtomContext when using default params #217

Merged
merged 1 commit into from
Mar 16, 2025

Conversation

bowheart
Copy link
Collaborator

Description

When passing default params to useAtomContext, Zedux gets or creates the instance for those params if no instance is provided. This operation currently happens without access to scope and without flagging the current context as unsafe for effects to run immediately.

So provide the react context scope to the ecosystem.getInstance call in useAtomContext. Also switch to getNode. The react context scope also automatically (currently) flags the context as unsafe for effects. Add a test for that.

@bowheart bowheart merged commit 21914de into master Mar 16, 2025
2 checks passed
@bowheart bowheart deleted the josh/context-default-fix branch March 16, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant