react-transition-group icon indicating copy to clipboard operation
react-transition-group copied to clipboard

SwitchTransition infinite loop between exit and enter state

Open floxrot opened this issue 3 years ago • 1 comments

What is the current behavior?

As soon as I insert a <SwitchTransition> into a <CSSTransition> 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

floxrot avatar Nov 12 '22 06:11 floxrot

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

AmrAhmedA avatar Mar 12 '23 12:03 AmrAhmedA