Basic react-router 4 setup for login and protected routes. Requires the user to log in in order to see those protected routes.
- Assuming there is a
UserStore
that performs actual operations (e.g. ajax calls) and provides auser
prop to components when the user is logged in. - Omitting any insiginificant import statements. This is not 100% copy-pastable, but still pretty much real-world code