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

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
youjia727 opened this issue May 17, 2024 · 5 comments

Comments

@youjia727
Copy link

react18.3.1 indicates that findDOMNode is deprecated
图片

@arudenkoofficial
Copy link

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

@pzm666
Copy link

pzm666 commented Jun 19, 2024

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

@sscaff1
Copy link

sscaff1 commented Jun 28, 2024

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

@turnflowerdown
Copy link

turnflowerdown commented Jul 2, 2024

you can use nodeRef prop
image

@wp993080086
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants