Last active
December 6, 2021 19:24
-
-
Save jthrilly/76cdf20737cfff25b847c8504cb486b1 to your computer and use it in GitHub Desktop.
R34 Sample Screen Structure
This file contains hidden or 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
// Main router (App.js) might look like this: | |
<Switch location={location} key={location.pathname}> | |
<Route exact path="/"> | |
<Home /> | |
</Route> | |
<Route exact path="/data-quality"> | |
<DataQuality /> | |
</Route> | |
<Route exact path="/background"> | |
<Background /> | |
</Route> | |
<Route exact path="/trust-and-disclosure"> | |
<TrustAndDisclosure /> | |
</Route> | |
<Route exact path="/efficiency"> | |
<Efficiency /> | |
</Route> | |
</Switch> | |
// Stream component might look like this: | |
let { path, url } = useRouteMatch(); | |
<Stream> | |
<Switch> | |
<Route exact path={path}> // Root 'page'. e.g website.com/stream/ | |
<DataQualityIntro> | |
</Route> | |
<Route path={`${path}/some-page`}> | |
<SomePage> | |
</Route> | |
</Switch> | |
</Stream> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment