Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --some code --
- let Navbar = props => {
- return (
- <div className='menu'>
- <Link to='/'>Home</Link>
- <a href='#'>Discover</a>
- <Link to='/me'>Me</Link>
- <a onClick={()=>{props.logoutFunc(props.store._kmd.authtoken)}}>Logout</a>
- </div>
- )
- }
- -- some more code
- ----!!Switch starts here!!--
- let ElementBlender = props => {
- if (Object.keys(props.store.auth).length===0) {
- return (
- <Switch>
- <Route path='/' component={Auth} />
- </Switch>
- )
- }
- return (
- <Switch>
- <Route path="/me" component={Me} />
- <Route exact path="/" component={Home} />
- </Switch>
- )
- }
- --- more code goes here ---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement