react-transition-group
Advanced tools
Changelog
4.4.1 (2020-05-06)
nodeRef
alternative instead of internal findDOMNode
(#559) (85016bf)
react-transition-group internally uses findDOMNode
, which is deprecated and produces warnings in Strict Mode, so now you can optionally pass nodeRef
to Transition
and CSSTransition
, it's a ref object that should point to the transitioning child:
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>
)
}
Transition
to match the exported ones (#554)Changelog
4.4.1 (2020-05-06)
nodeRef
alternative instead of internal findDOMNode
(#559) (85016bf)
react-transition-group internally uses findDOMNode
, which is deprecated and produces warnings in Strict Mode, so now you can optionally pass nodeRef
to Transition
and CSSTransition
, it's a ref object that should point to the transitioning child:
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>
)
}
Transition
to match the exported ones (#554)