Created
February 27, 2022 00:08
-
-
Save bobdobbs/25c68ab7a7405b4f49fb5a0d2de503e4 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
// File: /packages/my-first-theme/src/components/index.js | |
// ... | |
import Post from "./post" | |
const Root = ({ state }) => { | |
const data = state.source.get(state.router.link) | |
return ( | |
<> | |
{/* ... */} | |
<Switch> | |
<List when={data.isArchive} /> | |
<Post when={data.isPost} /> | |
<Post when={data.isPage} /> | |
</Switch> | |
</> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment