Skip to content

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. #904

Open

Description

@youjia727

react18.3.1 indicates that findDOMNode is deprecated
图片

Activity

  1. arudenkoofficial commented on May 20, 2024

    @arudenkoofficial

    @youjia727 Seems that you didn't pass nodeRef prop, referencing DOM element needs to transition. Check it out on the documentation –nodeRef

  2. pzm666 commented on Jun 19, 2024

    @pzm666

    According to the React documentation, findDOMNode is about to be deprecated and removed, and needs to be replaced with a ref to read the component's own DOM node

  3. sscaff1 commented on Jun 28, 2024

    @sscaff1

    Is there a PR up for this yet? It seems react-transition-group doesn't work with v19 beta.

  4. turnflowerdown commented on Jul 2, 2024

    @turnflowerdown

    you can use nodeRef prop
    image

  5. wp993080086 commented on Dec 30, 2024

    @wp993080086

    v4.4.0中已修复:

    import React from "react"
    import { CSSTransition } from "react-transition-group"
    
    const MyComponent = () => {
      const nodeRef = React.useRef(null)
      return (
        <CSSTransition nodeRef={nodeRef} in timeout={200} classNames="fade">
          <div ref={nodeRef}>Fade</div>
        </CSSTransition>
      )
    }
    
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions