Type problem with persist #2176
-
SummaryCode I've written for 4.4.4 which is working very fine, gave typescript error on 4.4.5 argument of type 'StateCreator<useCartType, [], [["zustand/persist", useCartType]]>' is not assignable to parameter of type 'StateCreator<useCartType, [], [never, unknown][]>'. Type 'StateCreator<useCartType, [], [["zustand/persist", useCartType]]>' is not assignable to type '{ $$storeMutators?: [never, unknown][] | undefined; }'. Types of property '$$storeMutators' are incompatible. Type '[["zustand/persist", useCartType]] | undefined' is not assignable to type '[never, unknown][] | undefined'. Type '[["zustand/persist", useCartType]]' is not assignable to type '[never, unknown][]'. Type '["zustand/persist", useCartType]' is not assignable to type '[never, unknown]'. Type at position 0 in source is not compatible with type at position 0 in target. Type 'string' is not assignable to type 'never'. Link to reproductionhttps://github.com/nerkn/ecommerce-Frontend/blob/main/src/hooks/useCart.ts Check List
Please include a minimal reproduction.
Please check this if you're filing an issue regarding TypeScript.
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
Can concur, experiencing the same issue with using the |
Beta Was this translation helpful? Give feedback.
-
I was about to submit this on Tuesday but couldn't reproduce it. Since wednesday was holiday, I just got around to it. What a coincidence that you beat me by 39 minutes. Here is my reproduction: It only happens with |
Beta Was this translation helpful? Give feedback.
-
I have the same issue |
Beta Was this translation helpful? Give feedback.
-
@nerkn @jwindhager @alexanderhorner @eisa-rezaei here's the fix -> #2170 you can show your love there hehe. BTW, if you can help us test out the changes using the local instructions would be good so @dai-shi can merge it as soon as possible |
Beta Was this translation helpful? Give feedback.
-
I have the same issue on zustand 4.4.7 |
Beta Was this translation helpful? Give feedback.
@nerkn @jwindhager @alexanderhorner @eisa-rezaei here's the fix -> #2170 you can show your love there hehe. BTW, if you can help us test out the changes using the local instructions would be good so @dai-shi can merge it as soon as possible