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:
parent
af9214b302
commit
9d50f8afb5
|
@ -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>
|
||||
|
|
|
@ -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,12 +69,17 @@ const Animated = styled.div`
|
|||
|
||||
export default () => {
|
||||
return (
|
||||
<div>
|
||||
<Basic>Cool Styles</Basic>
|
||||
<Combined>
|
||||
With <code>:hover</code>.
|
||||
</Combined>
|
||||
<Animated animation={bounce}>Let's bounce.</Animated>
|
||||
</div>
|
||||
<>
|
||||
<Head>
|
||||
<title>With Emotion</title>
|
||||
</Head>
|
||||
<div>
|
||||
<Basic>Cool Styles</Basic>
|
||||
<Combined>
|
||||
With <code>:hover</code>.
|
||||
</Combined>
|
||||
<Animated animation={bounce}>Let's bounce.</Animated>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue