Skip to content

An exception is thrown when using Mobx6 and react18 in development mode #3492

@guochengcheng04

Description

@guochengcheng04

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

Dzdw92s8dG

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions