Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit f793860

Browse files
authored
Update emotion (#69)
* remove previous packages * add new packages * refactor emotion stuff
1 parent 38b6e38 commit f793860

File tree

5 files changed

+177
-210
lines changed

5 files changed

+177
-210
lines changed

next-env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/// <reference types="next" />
22
/// <reference types="next/types/global" />
3+
/// <reference types="@emotion/react/types/css-prop" />

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
"test": "jest --watch"
1111
},
1212
"dependencies": {
13-
"@emotion/core": "^10.1.1",
14-
"@emotion/styled": "^10.0.27",
13+
"@emotion/babel-preset-css-prop": "^11.2.0",
14+
"@emotion/css": "^11.1.3",
15+
"@emotion/react": "^11.1.5",
16+
"@emotion/server": "^11.0.0",
1517
"@next/mdx": "^10.0.6",
1618
"dotenv-flow": "^3.2.0",
17-
"emotion": "^10.0.27",
18-
"emotion-server": "^10.0.27",
1919
"mdx-prism": "^0.3.1",
2020
"next": "10.0.8",
2121
"next-seo": "^4.19.0",
@@ -30,7 +30,6 @@
3030
},
3131
"devDependencies": {
3232
"@babel/plugin-transform-react-jsx": "^7.12.16",
33-
"@emotion/babel-preset-css-prop": "^10.2.1",
3433
"@mdx-js/loader": "^1.6.22",
3534
"@tailwindcss/typography": "^0.4.0",
3635
"@testing-library/jest-dom": "^5.11.9",

src/pages/_document.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import Document, {
66
NextScript,
77
DocumentContext,
88
} from 'next/document'
9-
import {extractCritical} from 'emotion-server'
9+
import createEmotionServer from '@emotion/server/create-instance'
10+
import {cache} from '@emotion/css'
11+
12+
const {extractCritical} = createEmotionServer(cache)
1013

1114
export default class MyDocument extends Document {
1215
static async getInitialProps(ctx: DocumentContext) {

src/pages/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {jsx} from '@emotion/core'
1+
import React from 'react'
22
import Head from 'next/head'
33
import DarkModeToggle from '../components/dark-mode-toggle'
44

0 commit comments

Comments
 (0)