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

feat(react): check for React.use before using; partially support React 18 #198

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

bowheart
Copy link
Collaborator

Description

We can use React's default export to check if React 19's use util exists before using it. Throw an error if it doesn't to let the user know that scoped atoms can only hook into React context in React 19. If you can't upgrade to React 19, you can still use scoped atoms manually via ecosystem.withScope.

With this PR, Zedux v2 now works in React 18 non-strict-mode, you just probably won't want to use scoped atoms until upgrading to React 19.

@bowheart bowheart merged commit 6d13566 into master Feb 28, 2025
2 checks passed
@bowheart bowheart deleted the josh/check-use branch February 28, 2025 19:07
@bowheart bowheart added this to the Zedux v2 milestone Mar 4, 2025
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