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: Update zustand peerDependencies/example dependency; Fix test #11

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

mark2685
Copy link
Contributor

Production Error

Issue occurs when trying to use zustand/middleware/immer with zustand-computed:

Argument of type 'StateCreator<Store & ComputedStore, [], [["zustand/devtools", never], ...[keyof StoreMutators<unknown, unknown>, unknown][]]>' is not assignable to parameter of type 'StateCreator<Store, [], [["zustand/devtools", never], ...[keyof StoreMutators<unknown, unknown>, unknown][]]>'.
Types of parameters 'getState' and 'getState' are incompatible.
Type 'Store' is not assignable to type 'Store & ComputedStore'.
Property 'countSq' is missing in type 'Store' but required in type 'ComputedStore'.ts(2345)
App.tsx(15, 3): 'countSq' is declared here.

Error is also reproduced in example/src/App.tsx.

Steps to resolve:

Deleting the yarn.lock file and generating a new file via yarn install will resolve the issue, but I'm not sure exactly why it was occurring with the lock file.

While testing, I noticed some zustand version inconsistencies and an issue with the example test. so updated those as well.

Note: zustand upgrade to 4.3.8 is not required to fix, this could be fixed while using 4.3.2 with the steps above. But seemed safe to include those as part of this update.

@chrisvander chrisvander merged commit 518083d into chrisvander:main Sep 15, 2023
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