-
Notifications
You must be signed in to change notification settings - Fork 10
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
I'm using a combination of immer middleware and typescript, but my computedState type doesn't exist! #24
Comments
Because your create call is Try using |
PS. You can see the ComputedState in my first screenshot |
Could you provide a reproduction in a TypeScript playground? This is the closest I got, but as you can see, the store is properly returning the computed state. Additionally, you could try explicitly typing the order of mutators on the Immer middleware the way I do in that playground. It appears that, when contained within the |
Okay, figured out the issue with the Zustand maintainer. Immer itself may still allow you to "set" the computed state, which should not be possible, but I've opened #2696 to address that issue on Zustand's side. As far as the type inference goes, I'm releasing version 2.0.0 of Please let me know if there are still any issues. |
OK, thanks, I will upgrade to zustand-computed |
Can you make a minimal reproduction of the issue in TypeScript playground, using Zustand 5.0.0-rc1? |
Here is my code:
The following screenshot shows the properties of my computedState:
I merged the type of computedState
but!!!
I am configuring this according to the documentation, and the computed properties are fetched as expected, just the typescript exception, what should I do to fix this typescript error?
The text was updated successfully, but these errors were encountered: