with immer midderware, Array type wrong #2152
-
an immer store, can't use Arrray.sort, but TS check escaped. Error in /~/src/App.tsx (23:62) demo : https://stackblitz.com/edit/stackblitz-starters-ebbhts?file=src/App.tsx hope TS checker can emit error correctly |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
Is it |
Beta Was this translation helpful? Give feedback.
-
Not sure if anything can be done on zustand end. Here's the code without types: https://unpkg.com/browse/zustand@4.4.4/esm/middleware/immer.mjs |
Beta Was this translation helpful? Give feedback.
-
Im not sure its a good way,because i can not Ask my colleagues to do the same |
Beta Was this translation helpful? Give feedback.
-
this is the good way |
Beta Was this translation helpful? Give feedback.
-
https://immerjs.github.io/immer/typescript#best-practices Immer Best practices |
Beta Was this translation helpful? Give feedback.
https://immerjs.github.io/immer/typescript#best-practices
Immer Best practices