I am developing an application in which I check if the user is not loggedIn. I have to display the login form, else dispatch an action
loggedIn
dispatch
action
In react-router version 4:
import React from 'react' import { BrowserRouter as Router, Route, Redirect} from 'react-router-dom' const Example = () => ( if (isLoggedIn) { } else { } ) const Login = () => ( Form Components ... ) export default Example;