Closed
Description
When changing key prop of Transition in a TransitionGroup a new nodeRef need to be provided to Transition with changed key prop (see test/CSSTransition-test.js).
-- https://reactcommunity.org/react-transition-group/transition
Could you clarify why and how we would accomplish this (the linked test doesn't use nodeRef)?
It sounds like useRef
wouldn't work for that since that one never changes. Instead we'd have to do something like const nodeRef = React.useMemo(() => ({ current: null }), [key]);
.
Isn't the point of a "ref" that you don't need to change it because the pointer (current
) always points to the latest value?
Metadata
Metadata
Assignees
Labels
No labels