Skip to content

Commit

Permalink
Merge pull request #5725 from marmelab/fix-Deprecated-findDOMNode-war…
Browse files Browse the repository at this point in the history
…ning-in-StrictMode

Fix findDOMNode warning in StrictMode when using SimpleformIterator
  • Loading branch information
djhi authored Jan 4, 2021
2 parents 9713d88 + 2512256 commit 127a968
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/ra-ui-materialui/src/form/SimpleFormIterator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const SimpleFormIterator: FC<SimpleFormIteratorProps> = props => {
defaultValue,
} = props;
const classes = useStyles(props);
const nodeRef = useRef(null);

// We need a unique id for each field for a proper enter/exit animation
// so we keep an internal map between the field position and an auto-increment id
Expand Down Expand Up @@ -184,6 +185,7 @@ const SimpleFormIterator: FC<SimpleFormIteratorProps> = props => {
<TransitionGroup component={null}>
{fields.map((member, index) => (
<CSSTransition
nodeRef={nodeRef}
key={ids.current[index]}
timeout={500}
classNames="fade"
Expand Down

0 comments on commit 127a968

Please # to comment.