mobxjs / mobx-react-devtools

[DEPRECATED] Tools to perform runtime analyses of React applications powered by MobX and React
MIT License
1.23k stars 49 forks source link

Incompatibility with React.StrictMode #116

Open elektronik2k5 opened 5 years ago

elektronik2k5 commented 5 years ago

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 commented 5 years ago

I recommend to use the browser plugin for now. The future of this tool is a bit uncertain, as it might be largely not needed anymore once we standardize on hooks

On Fri, Apr 12, 2019 at 2:07 PM Nick Ribal notifications@github.com wrote:

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 https://reactjs.org/docs/strict-mode.html. 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:

<>

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 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .