Skip to content

How to type store with generic data #2566

Answered by dai-shi
ampossardt asked this question in Q&A
Discussion options

You must be logged in to vote

It seems like you are facing a tricky situation. Zustand types are somewhat optimized for some use cases which may conflict with generics use case.
The easiest way would be as any, because your types are stricter than what Zustand infers.

Anyway, I hope this helps.
https://tsplay.dev/NB6OgN

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ampossardt
Comment options

Answer selected by ampossardt
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants