Skip to content

Commit 3c92524

Browse files
silvenontimneutkens
authored andcommitted
Update example with emotion (vercel#2837)
* Update example with emotion Emotion is now split into separate packages using Lerna. * Update Next.js in emotion example
1 parent 50866c2 commit 3c92524

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

examples/with-emotion/.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"next/babel"
44
],
55
"plugins": [
6-
["emotion/babel", { "inline": true }]
6+
["emotion", { "inline": true }]
77
]
88
}

examples/with-emotion/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
"start": "next start"
88
},
99
"dependencies": {
10-
"emotion": "^5.1.4",
11-
"next": "^2.4.6",
10+
"babel-plugin-emotion": "^7.1.0",
11+
"emotion": "^7.2.0",
12+
"emotion-server": "^7.2.0",
13+
"next": "^3.0.6",
1214
"react": "^15.6.1",
13-
"react-dom": "^15.6.1"
15+
"react-dom": "^15.6.1",
16+
"react-emotion": "^7.2.0"
1417
},
1518
"license": "ISC"
1619
}

examples/with-emotion/pages/_document.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Document, { Head, Main, NextScript } from 'next/document'
2-
import { extractCritical } from 'emotion/server'
2+
import { extractCritical } from 'emotion-server'
33
import { flush } from 'emotion'
44

55
const dev = process.env.NODE_ENV !== 'production'

examples/with-emotion/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { hydrate, keyframes, css, injectGlobal } from 'emotion'
3-
import styled from 'emotion/react'
3+
import styled from 'react-emotion'
44

55
// Adds server generated styles to emotion cache.
66
// '__NEXT_DATA__.ids' is set in '_document.js'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy