Ok, I\'m fed up trying.
The onEnter method doesn\'t work. Any idea why is that?
// Authentication \"before\" filter
function requireAuth(ne
From react-router-v4 onEnter, onUpdate, and onLeave is removed,
according the documentation on migrating from v2/v3 to v4:
on*properties
React Router v3 providesonEnter,onUpdate, andonLeavemethods. These were essentially recreating React's lifecycle methods.With v4, you should use the lifecycle methods of the component rendered by a
. Instead ofonEnter, you would usecomponentDidMountorcomponentWillMount. Where you would useonUpdate, you can usecomponentDidUpdateorcomponentWillUpdate(or possiblycomponentWillReceiveProps).onLeavecan be replaced withcomponentWillUnmount.