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

React 16.6 StrictMode: findDOMNode is deprecated in StrictMode #1406

Closed
apepper opened this issue Oct 24, 2018 · 6 comments · Fixed by #1442
Closed

React 16.6 StrictMode: findDOMNode is deprecated in StrictMode #1406

apepper opened this issue Oct 24, 2018 · 6 comments · Fixed by #1442

Comments

@apepper
Copy link

apepper commented Oct 24, 2018

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.

@akiran
Copy link
Owner

akiran commented Oct 24, 2018

Thanks @apepper

Can you raise a PR to fix this issue ?

@apepper
Copy link
Author

apepper commented Oct 24, 2018

Can you raise a PR to fix this issue ?

Sorry, but no.

@andreytrofimov
Copy link
Contributor

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

@remidej
Copy link

remidej commented Oct 25, 2019

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

@NasKadir123
Copy link

Thanks @apepper

Can you raise a PR to fix this issue ?

Hi, @akiran! Is this issue still unsolved?
I'm getting the same error in react 16.10.0.
Thanks in advance.

@stahlmanDesign
Copy link

I think this PR could be safely accepted as it won't break any of the slider functionality, it's just a react maintenance issue.

akiran added a commit that referenced this issue Jul 17, 2020
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

Successfully merging a pull request may close this issue.

6 participants