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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -