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

use zustand context instead of react context for provider #481

Closed
wants to merge 1 commit into from

Conversation

talentlessguy
Copy link

this PR needs to be tested and reviewed bc it probably doesn't work, but the idea is that we should use zustand/context instead of React context bc it's more performant and we already use zustand in w3r

@vercel
Copy link

vercel bot commented Mar 20, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/noahwz/web3-react/6bjJGYUMGwfes8nypK7PhkmNUgrP
✅ Preview: https://web3-react-git-fix-use-zustand-context-noahwz.vercel.app

@talentlessguy
Copy link
Author

@NoahZinsmeister could you take a look at this please? and test if it works / add required changes

@NoahZinsmeister
Copy link
Contributor

is the zustand context really that much more performant than react?

per the latest (v4) docs, seems like the native react context is recommended: https://github.com/pmndrs/zustand#react-context. admittedly, in that example the value of that context is a zustand store, not "raw" data, but i still can't imagine it's that much better.

however, if it is, i'd be willing to pass down a store.

@talentlessguy
Copy link
Author

ok got it, then I'll close the PR

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.

2 participants