Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with React.StrictMode #116

Open
elektronik2k5 opened this issue Apr 12, 2019 · 1 comment
Open

Incompatibility with React.StrictMode #116

elektronik2k5 opened this issue Apr 12, 2019 · 1 comment

Comments

@elektronik2k5
Copy link

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

@mweststrate
Copy link
Member

mweststrate commented Apr 15, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants