Last active
May 11, 2019 07:27
-
-
Save alshdavid/da25e743312208e288aa63d9c6f90a56 to your computer and use it in GitHub Desktop.
Animated Routes
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
import React from 'react' | |
export const About = (req, nav) => () => ( | |
<main> | |
<nav> | |
<div> | |
<button onClick={() => nav.navigate('/home')}>Home</button> | |
<button onClick={() => nav.navigate('/about')}>About</button> | |
</div> | |
<div> | |
<button onClick={() => nav.navigate('/more')}>More ></button> | |
</div> | |
</nav> | |
<h1>{ req.pathname }</h1> | |
</main> | |
) |
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
import React from 'react' | |
export const Home = (req, nav) => () => ( | |
<main> | |
<nav> | |
<div> | |
<button onClick={() => nav.navigate('/home')}>Home</button> | |
<button onClick={() => nav.navigate('/about')}>About</button> | |
</div> | |
<div> | |
<button onClick={() => nav.navigate('/more')}>More ></button> | |
</div> | |
</nav> | |
<h1>{ req.pathname }</h1> | |
</main> | |
) |
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
import React from 'react' | |
export const More = (req, nav) => () => ( | |
<main> | |
<nav> | |
<div> | |
<button onClick={() => nav.back()}>< Back</button> | |
</div> | |
</nav> | |
<h1>{ req.pathname }</h1> | |
</main> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment