Skip to content

StrictMode warning for findDOMNode and legacy context API in Transition as of React 16.6 #429

Closed
@TAGraves

Description

@TAGraves

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?
When using <Transition /> inside of <React.StrictMode />, warnings are logged about findDOMNode and the legacy context API (as of React 16.6)

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via CodeSandbox.
View the console at https://codesandbox.io/s/y0r3kl6x1j. On mount, you'll see:

Warning: Legacy context API has been detected within a strict-mode tree

and after clicking "Toggle in Prop", you'll see:

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

What is the expected behavior?
No warning should be logged.

Which versions, and which browser / OS are affected by this issue? Did this work in previous versions?
These warnings are new as of React 16.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions