mobx-state-tree
mobx-state-tree copied to clipboard
Typcheck doesn't work correctly for instances in production mode
Bug report
- [X] I've checked documentation and searched for existing issues
- [X] I've made sure my project is based on the latest MST version
Sandbox link or minimal reproduction code https://codesandbox.io/s/funny-fire-xux5i?file=/src/index.js
Describe the expected behavior According to documentation, typecheck should work both for the instance and for the snapshot.
Describe the observed behavior Incorrect data doesn't cause typecheck to throw when using the instance. Since in production mode you can create an instance without any type checks, this can lead to errors in production.