reactjs - componentDidMount fires twice when using TransitionGroup for animation -


i'm using react-transition-group in conjunction react-router-dom animate route changes , working fine.

the issue i'm having when switching routes , need send or fetch data in componentdidmount life-cycle hook, fires twice. i'm sure due react-transition-group wondering if there obvious solution issue.

i discovered inserting entity in database twice, far intended behavior.

example of transition logging in componentdidmount enter image description here

i've found issue switch component, see github issue

basically need location prop in wrapped switch component.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -