reactjs / react-transition-group

An easy way to perform animations when a React component enters or leaves the DOM
https://reactcommunity.org/react-transition-group/
Other
10.1k stars 652 forks source link

SwitchTransition infinite loop between exit and enter state #866

Open floxrot opened 1 year ago

floxrot commented 1 year ago

What is the current behavior?

As soon as I insert a into a component, once it is activated, an infinite loop is created between classes named enter and exit. It jumps back and forth between the two classes without any intermediate stages.

What is the expected behavior?

No infinite loop between enter and exit

Could you provide a CodeSandbox demo reproducing the bug?

codesandbox with issue

AmrAhmedA commented 1 year ago

@floxrot you have to provide key prop to the CssTransition to prevent infinite loop for your transitions. key ={isSuccessful? "trueText": "notTrueText"}