Commit 02551d3b authored by Kuba Juszczyk's avatar Kuba Juszczyk Committed by Tim Neutkens

Disable <title/> warning when React Helmet is used (#7483)

parent cc6eecd2
......@@ -207,7 +207,8 @@ export class Head extends Component<OriginProps> {
// show a warning if Head contains <title> (only in development)
if (process.env.NODE_ENV !== 'production') {
children = React.Children.map(children, (child: any) => {
if (child && child.type === 'title') {
const isReactHelmet = child && child.props && child.props['data-react-helmet']
if (child && child.type === 'title' && !isReactHelmet) {
console.warn(
"Warning: <title> should not be used in _document.js's <Head>. https://err.sh/next.js/no-document-title"
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment