Created
November 21, 2020 17:35
-
-
Save moaoa/16b252707928b4e58acfa5fa1097a4e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Switch> | |
{!user && <Redirect exact from='/' to='/auth' />} | |
// you can only place the Redirect component inside the Switch Component if you are using the from to sytax | |
{user && <Redirect exact from='/' to='/dashboard'/>} | |
{user && <Redirect from='/auth' to='/dashboard'/>} | |
<Route path='/auth' component={AuthPage}/> | |
<Route path='/landing' component={LandingPage} /> | |
<Route path='/' component={ProjectPage}/> | |
</Switch> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment