Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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