You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to react, react-router, and redux - 1 day to be precise - so please bear with me. I created a basic example from the redux examples, https://github.com/jstrimpel/redux-react-router. The issue I am facing is that I cannot get static willTransitionTo to fire. I have added one to both the ./Root.js and ./App.js components. Any help would be greatly appreciated. I tried joining the recommended Slack community to get help, but it fails to send me an invite email.
The text was updated successfully, but these errors were encountered:
@jstrimpel The problem is you're declaring willTransitionTo on the inner component. connect() will return a different component, which is the one the router will see. The fix is simple:
classAppextendsComponent{render(){let{ fname, lname }=this.props;return(<div>Hello {fname}{lname}!</div>);}}functionselect(state){returnstate;}App=connect(select)(App)// Put static on the outer component!App.willTransitionTo=function(){console.log('willTransitionTo in App component');};
I am new to react, react-router, and redux - 1 day to be precise - so please bear with me. I created a basic example from the redux examples, https://github.com/jstrimpel/redux-react-router. The issue I am facing is that I cannot get
static willTransitionTo
to fire. I have added one to both the./Root.js
and./App.js
components. Any help would be greatly appreciated. I tried joining the recommended Slack community to get help, but it fails to send me an invite email.The text was updated successfully, but these errors were encountered: