You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the documentation, object of type 'class' needs to have [immerable] set to true to be handled.
When [immerable] is not set, it should throw an exception.
However, if the baseObject is plain javascript/(class with immerable set to true) and the nested object is un-draftable(class without immerable), then the baseObject itself is modified and returned without exception.
That is working as expected, if a class is not marked immerable, it behaves like it would normally do in JavaScript. The fact that it is referred to by a draft is unrelated to that.
Thanks for the clarification.
It will be difficult for us to adopt immer without a exception failure, as we have a highly nested class structure and multiple developers introducing new changes.
🐛 Bug Report
Based on the documentation, object of type 'class' needs to have [immerable] set to true to be handled.
When [immerable] is not set, it should throw an exception.
However, if the baseObject is plain javascript/(class with immerable set to true) and the nested object is un-draftable(class without immerable), then the baseObject itself is modified and returned without exception.
Link to repro
https://codesandbox.io/s/immer-sandbox-error-forked-rry8q
Observed behavior
BaseObject is modified and returned. No exception is thrown.
Expected behavior
Exception should be thrown.
Environment
We only accept bug reports against the latest Immer version.
setUseProxies(true)
setUseProxies(false)
(ES5 only)The text was updated successfully, but these errors were encountered: