Inferred Zustand types...
Hi,
New to Zustand. The typescript guide says you can infer types with
combine
but this makes it tricky to do nested state. I found that simply doing seems to work, but this seems too easy. All the examples have the state explicitly created, not inferred. Am I missing something obvious?4 Replies
Like I'm guessing a limitation is that the type is only what is inferred, so that might limit you
But that limitation exists when inferring state as well with
combine
or even something like thisUnknown User•3y ago
Message Not Public
Sign In & Join Server To View
Is there a reason I can't just infer my state like this?
I know there is
combine
, the Zustand docs talk about how it's not possible to infer state otherwise because state generic T is invariant. But this seems to work, so...