mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
190853b4ff
* Support de-deduping head tags by setting key * move dedupe logic to `unique` function * fix head tag deduping logic * remove console.log * use `toContain` assertions * update de-duping head tags section in README
23 lines
675 B
JavaScript
23 lines
675 B
JavaScript
import React from 'react'
|
|
import Head from 'next/head'
|
|
|
|
export default () => <div>
|
|
<Head>
|
|
{/* this will not render */}
|
|
<meta charSet='utf-8' />
|
|
{/* this will get rendered */}
|
|
<meta charSet='iso-8859-5' />
|
|
|
|
<meta content='my meta' />
|
|
|
|
{/* the following 2 links tag will be rendered both */}
|
|
<link rel='stylesheet' href='/dup-style.css' />
|
|
<link rel='stylesheet' href='/dup-style.css' />
|
|
|
|
{/* only one tag will be rendered as they have the same key */}
|
|
<link rel='stylesheet' href='dedupe-style.css' key='my-style' />
|
|
<link rel='stylesheet' href='dedupe-style.css' key='my-style' />
|
|
</Head>
|
|
<h1>I can haz meta tags</h1>
|
|
</div>
|