Skip to content

findDOMNode will be deprecated #141

Description

@dsempel

Starting from React 16.6 it is deprecated in StrictMode and it will be deprecated from React in the future. Here is some more information about this.

The docs state the following:

Normally you don’t need this because you can attach a ref directly to a DOM node.

However, reading through the source code I see that VisibilitySensor is not rendering any DOM nodes itself, so I'm not sure what would be the best way to attach the ref.

The warning in StrictMode:

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

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions