question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React 16.6 StrictMode: findDOMNode is deprecated in StrictMode

See original GitHub issue

First of all, thanks for your package. It’s quite a help to have it.

I just checked out the latest react 16.6.0 release. They extended APIs in StrictMode, that are now considered deprecated. findDOMNode is now considered deprecated. See https://reactjs.org/blog/2018/10/23/react-v-16-6.html#deprecations-in-strictmode for the full list.

If you add React.StrictMode around Slick you’ll get the following console warning:

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

    in div (created by Track)
    in Track (created by InnerSlider)
    in div (created by InnerSlider)
    in div (created by InnerSlider)
    in InnerSlider (created by Slider)
    in Slider (created by ReactSlickDemo)
    in div (created by ReactSlickDemo)
    in StrictMode (created by ReactSlickDemo)
    in ReactSlickDemo

Learn more about using refs safely here:
https://fb.me/react-strict-mode-find-node

See it live on https://codesandbox.io/s/8j39k1pq8. Also see https://fb.me/react-strict-mode-find-node for how to get rid of the warning.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
remidejcommented, Oct 25, 2019

Pinging this issue, since strict mode is becoming more necessary with React concurrent mode coming up. @akiran could you review #1442 ?

1reaction
andreytrofimovcommented, Dec 13, 2018

Hi @akiran Could you check PR #1442 to fix this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

findDOMNode is deprecated in StrictMode. ...
If running in React Strict mode, ReactDOM.findDOMNode() is deprecated. * Unfortunately, in order for <Draggable> to work properly, ...
Read more >
Warning: findDOMNode is deprecated in StrictMode. React ...
Hi,. I was recently trying to upgrade from React 16.5 to React 16.6 in which they have deprecated the findDomNode function in the...
Read more >
React warning: findDOMNode is deprecated in StrictMode ...
When working with React.js, you will probably come across an annoying warning: Warning: findDOMNode is deprecated in StrictMode.
Read more >
How do I fix warning findDOMNode is deprecated ... - YouTube
How to fix finddomnode warning with two different method :Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an ...
Read more >
Strict Mode
Identifying components with unsafe lifecycles; Warning about legacy string ref API usage; Warning about deprecated findDOMNode usage; Detecting unexpected ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found