Skip to content

Commit

Permalink
Fix findDOMNode warning in StrictMode when using SimpleformIterator
Browse files Browse the repository at this point in the history
Closes #5693
  • Loading branch information
fzaninotto committed Jan 3, 2021
1 parent a25dced commit 2512256
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 2512256

Please sign in to comment.