Skip to content

Instantly share code, notes, and snippets.

@apaleslimghost
Created January 25, 2021 11:19
Show Gist options
  • Save apaleslimghost/89a8c573571c6567f7b7e8cd200491d2 to your computer and use it in GitHub Desktop.
Save apaleslimghost/89a8c573571c6567f7b7e8cd200491d2 to your computer and use it in GitHub Desktop.
//////////// x-teaser ////////////
const Teaser = ({ teaser, enableStandfirst }) => <div class="o-teaser">
<h1>{teaser.title}</h1>
{enableStandfirst && <h2>{teaser.standfirst}</h2>}
</div>
//////// next-front-page /////////
app.get('/', (req, res) => {
res.send(
renderToString(
<Teaser enableStandfirst={res.locals.flags.get('enableStandfirst') === 'variant'} />
)
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment