0

Possible a noob question, but I am facing react router cycle problem here.

I've got

  • React Router,
  • ReactCSSTransitionGroup

I've got two versions of css animation, and would like to switch between them based on type of navigation. It's pretty simple with any kind of user interaction, except of browser back and forward buttons.

<ReactCSSTransitionGroup 
transitionName={this.state.animation} transitionEnterTimeout={600} transitionLeaveTimeout={600}>
(...)
</ReactCSSTransitionGroup>

Is there any event triggered after clicking native browser history navigation and before react transition css transition starts? I've tried browserHistory.listen, but it fires after animation started.

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
khola
  • 1
  • It sounds to me like you're using react-router v3. I know this is a horrible solution, but if you're early in the project, definitely swich to v4, it is just a component, on back/forward it gets destroyed and created and it will follow the transition group instructions. https://github.com/ReactTraining/react-router/issues/4351 – Noitidart Mar 29 '17 at 00:16
  • maybe my quersion was not precise - I've made it working using componentWillReceiveProps of container app, it seems to be fired before transition ;) – khola Mar 29 '17 at 09:29

0 Answers0