immerjs / use-immer

Use immer to drive state with a React hooks
MIT License
4.04k stars 92 forks source link

The first direct update of the immutable state doesn't throw an error #32

Closed asicfr closed 5 years ago

asicfr commented 5 years ago

In this example, i can use the incrementDirectly button of Counter without any error : https://codesandbox.io/s/nifty-jennings-1vmly

mweststrate commented 5 years ago

Probably we'll update this soon. It is not really the point of immer, but answering the same question over and over again is becoming a bit tiresome :-P.

On Wed, Aug 28, 2019 at 4:49 PM asic notifications@github.com wrote:

In this example, i can use the incrementDirectly button of Counter without any error : https://codesandbox.io/s/nifty-jennings-1vmly

— 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/32?email_source=notifications&email_token=AAN4NBABSM7G47C3YRU3YQTQG2F7JA5CNFSM4IRJE3QKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HH6LFIQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAN4NBBERBATMCRCBXQA6HLQG2F7JANCNFSM4IRJE3QA .

mweststrate commented 5 years ago

See https://github.com/immerjs/immer#auto-freezing / https://github.com/immerjs/immer/issues/412

(sorry, I only realized after clicking the notification link that this is reported on use-immer, not the immer package itself). Closing it here as it is duplicate from the original repository