Skip to content

Incompatibility with React.StrictMode #116

Description

@elektronik2k5

Hello and thanks for mobx and the devtools! :)

I'm trying to use the devtools in an app while using React's (relatively) new StrictMode. But I'm getting this error:

Warning: findDOMNode is deprecated in StrictMode.
findDOMNode was passed an instance of _class which is inside StrictMode.
Instead, add a ref directly to the element you want to reference.

The interesting thing is that it happens even when the devtools aren't mounted to a StrictMode tree:

<>
  <React.StrictMode>
    <TodoList todoStore={store} />
  </React.StrictMode>
  <MobxDevTools />
</>

I'm also able to reproduce the same issue in my real app.
Can anything be done about it? If not, we should at least have a note in the README.

Here's a codesandbox where you can see the issue: https://codesandbox.io/s/1jjgxvjzo?autoresize=1&expanddevtools=1&fontsize=14

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions