Closed lucax88x closed 5 years ago
Please read the readme first on how to use immer with classes.
Op wo 14 aug. 2019 11:11 schreef Luca Trazzi notifications@github.com:
REALLY?
Could be the cause?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/immerjs/use-immer/issues/31?email_source=notifications&email_token=AAN4NBBU2CETIMFCV254NKTQEPK5LA5CNFSM4ILTDMO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4IK4CY#issuecomment-521186827, or mute the thread https://github.com/notifications/unsubscribe-auth/AAN4NBG6QMQGYU6QJ4HSTKTQEPK5LANCNFSM4ILTDMOQ .
Ok, I can burn myself.
I'll close it, I hope at least it can help some poor guy like me in the web struggling with the same.
Thanks.
Hi guys, I don't know if this is a bug, but if it isn't, should be documented somewhere.
repro case:
https://stackblitz.com/edit/react-ts-qigunm
TLDR:
if you have class in the state, if this class has a constructor, and you pass values to it, when you try to modify a property of it on the reducer, immer does not detect that the property as changed, therefore does not trigger a rerender of the component and it stays the same value forever,
infos:
Help.
ps: let me know if I should address this one on the immer repository..