I would like to make use of react-router\'s onEnter handler in order to prompt users to authenticate when entering a restricted route.
onEnter
So far my route
route
Lots have changed over the time. onEnter no longer exists on react-router-4
react-router-4
The following is from my real project for your reference
export const getRoutes = (store) => { const PrivateRoute = ({ component: Component, ...rest }) => ( ( checkIfAuthed(store) ? ( ) : ( ) )}/> ) return ( ) }