mobx: An exception is thrown when using Mobx6 and react18 in development mode
Intended outcome:
When I use React18’s new rendering API ReactDOM.createRoot().render, I get a lot of warnings. It should be guaranteed to be consistent with the previous behavior, run normally, and not throw warnings
warning message: react_devtools_backend.js:3973 Warning: Can’t perform a React state update on a component that hasn’t mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.
Actual outcome:
I get a lot of warnings, but can’t find the information I have in it, like below
Versions
mobx@^6.6.1 mobx-react@^7.5.1

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (1 by maintainers)
Commits related to this issue
- Fix #3492: throw warning when use class component and suspense — committed to guochengcheng04/mobx by SagaciousLittle 2 years ago
- Fix #3492: throw warning when use class component and suspense — committed to guochengcheng04/mobx by SagaciousLittle 2 years ago
- Fix #3492: throw warning when use class component and suspense — committed to guochengcheng04/mobx by SagaciousLittle 2 years ago
- Fix #3492: throw warning when use class component and suspense — committed to guochengcheng04/mobx by SagaciousLittle 2 years ago
- Fix #3492: throw warning when use class component and suspense — committed to guochengcheng04/mobx by SagaciousLittle 2 years ago
- Fix #3492: throw warning when use class component and suspense — committed to guochengcheng04/mobx by SagaciousLittle 2 years ago
@kubk hello, this is the demo code link. https://codesandbox.io/s/mobx6-and-react18-2rx40e?file=/index.js