提交 3c92524b 编写于 作者: M Matija Marohnić 提交者: Tim Neutkens

Update example with emotion (#2837)

* Update example with emotion

Emotion is now split into separate packages using Lerna.

* Update Next.js in emotion example
上级 50866c23
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"next/babel" "next/babel"
], ],
"plugins": [ "plugins": [
["emotion/babel", { "inline": true }] ["emotion", { "inline": true }]
] ]
} }
\ No newline at end of file
...@@ -7,10 +7,13 @@ ...@@ -7,10 +7,13 @@
"start": "next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"emotion": "^5.1.4", "babel-plugin-emotion": "^7.1.0",
"next": "^2.4.6", "emotion": "^7.2.0",
"emotion-server": "^7.2.0",
"next": "^3.0.6",
"react": "^15.6.1", "react": "^15.6.1",
"react-dom": "^15.6.1" "react-dom": "^15.6.1",
"react-emotion": "^7.2.0"
}, },
"license": "ISC" "license": "ISC"
} }
import Document, { Head, Main, NextScript } from 'next/document' import Document, { Head, Main, NextScript } from 'next/document'
import { extractCritical } from 'emotion/server' import { extractCritical } from 'emotion-server'
import { flush } from 'emotion' import { flush } from 'emotion'
const dev = process.env.NODE_ENV !== 'production' const dev = process.env.NODE_ENV !== 'production'
......
import React from 'react' import React from 'react'
import { hydrate, keyframes, css, injectGlobal } from 'emotion' import { hydrate, keyframes, css, injectGlobal } from 'emotion'
import styled from 'emotion/react' import styled from 'react-emotion'
// Adds server generated styles to emotion cache. // Adds server generated styles to emotion cache.
// '__NEXT_DATA__.ids' is set in '_document.js' // '__NEXT_DATA__.ids' is set in '_document.js'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册