3 ms·
Yeah, this is generally a good compromise. I sometimes like to write these as helper components instead: <Layout> <Header /> <Content page={page} />
by uhoh-itsmaciek 5y ago
Yeah, this is generally a good compromise. I sometimes like to write these as helper components instead:
<Layout>
<Header />
<Content page={page} />
<Footer />
</Layout>
const Content = ({page}) => {
switch (page) {
case 'home': return <Home />
case 'about': return <About />
default: return <NotFound />
}
}