1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Update using emotion - fixes: Warning: <title> should not be used in _document.js's <Head> (#5454)

This commit is contained in:
Jan Czizikow 2018-10-15 17:02:19 +02:00 committed by Tim Neutkens
parent af9214b302
commit 9d50f8afb5
2 changed files with 13 additions and 8 deletions

View file

@ -20,7 +20,6 @@ export default class MyDocument extends Document {
return (
<html>
<Head>
<title>With Emotion</title>
<style dangerouslySetInnerHTML={{ __html: this.props.css }} />
</Head>
<body>

View file

@ -1,4 +1,5 @@
import React from 'react'
import Head from 'next/head'
import styled, { hydrate, keyframes, css, injectGlobal } from 'react-emotion'
// Adds server generated styles to emotion cache.
@ -68,6 +69,10 @@ const Animated = styled.div`
export default () => {
return (
<>
<Head>
<title>With Emotion</title>
</Head>
<div>
<Basic>Cool Styles</Basic>
<Combined>
@ -75,5 +80,6 @@ export default () => {
</Combined>
<Animated animation={bounce}>Let's bounce.</Animated>
</div>
</>
)
}