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

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -