Using the Modal component with React-Router is difficult because when changing the route to a route that doesn't contain the Modal, the exit animation doesn't have the time to finish before the Modal is removed from the dom.
The only solution i found until now is to close the modal manually and run setTimeout(hashHistory.push('/whatever'), 500), to let the modal quit properly before being removed from the dom, but it's a pretty ugly solution.
It would be better if we could run the OnExit function (or a new one) at the end of the exit animation so we could have more control on what's happening.
Using the Modal component with React-Router is difficult because when changing the route to a route that doesn't contain the Modal, the exit animation doesn't have the time to finish before the Modal is removed from the dom.
The only solution i found until now is to close the modal manually and run
setTimeout(hashHistory.push('/whatever'), 500), to let the modal quit properly before being removed from the dom, but it's a pretty ugly solution.It would be better if we could run the
OnExitfunction (or a new one) at the end of the exit animation so we could have more control on what's happening.