Commit 0b5cc6b028dd8f3199b4203e8f44c9bc54b35b65
fixes
romuloalves committed on 4/17/2021, 11:07:51 PMParent: 04f1928b97e35d5d5fe0cd9c216f1e431a121f33
Files changed
.babelrc | changed |
package-lock.json | changed |
package.json | changed |
pages/_document.tsx | changed |
.babelrc | ||
---|---|---|
@@ -1,4 +1,3 @@ | ||
1 | 1 … | { |
2 | - "presets": ["next/babel"], | |
3 | - "plugins": [["styled-components", { "ssr": true }]] | |
2 … | + "presets": ["next/babel"] | |
4 | 3 … | } |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 108009 bytes New file size: 94414 bytes |
package.json | ||
---|---|---|
@@ -18,15 +18,12 @@ | ||
18 | 18 … | "next": "^10.1.3", |
19 | 19 … | "next-seo": "^4.24.0", |
20 | 20 … | "react": "^17.0.2", |
21 | 21 … | "react-dom": "^17.0.2", |
22 | - "styled-components": "^5.2.3", | |
23 | 22 … | "styled-jsx": "^3.4.4" |
24 | 23 … | }, |
25 | 24 … | "devDependencies": { |
26 | 25 … | "@types/node": "^14.14.37", |
27 | 26 … | "@types/react": "^17.0.3", |
28 | - "@types/styled-components": "^5.1.9", | |
29 | - "babel-plugin-styled-components": "^1.12.0", | |
30 | 27 … | "typescript": "^4.2.4" |
31 | 28 … | } |
32 | 29 … | } |
pages/_document.tsx | ||
---|---|---|
@@ -1,33 +1,10 @@ | ||
1 | 1 … | import Document, { Html, Head, Main, NextScript } from 'next/document'; |
2 | -import { ServerStyleSheet } from 'styled-components'; | |
3 | 2 … | |
4 | 3 … | class MyDocument extends Document { |
5 | 4 … | static async getInitialProps(ctx) { |
6 | - const sheet = new ServerStyleSheet(); | |
7 | - const originalRenderPage = ctx.renderPage; | |
8 | 5 … | const initialProps = await Document.getInitialProps(ctx); |
9 | 6 … | |
10 | - try { | |
11 | - ctx.renderPage = () => | |
12 | - originalRenderPage({ | |
13 | - enhanceApp: App => props => sheet.collectStyles(<App {...props} />), | |
14 | - }) | |
15 | - | |
16 | - const initialProps = await Document.getInitialProps(ctx) | |
17 | - return { | |
18 | - ...initialProps, | |
19 | - styles: ( | |
20 | - <> | |
21 | - {initialProps.styles} | |
22 | - {sheet.getStyleElement()} | |
23 | - </> | |
24 | - ), | |
25 | - } | |
26 | - } finally { | |
27 | - sheet.seal() | |
28 | - } | |
29 | - | |
30 | 7 … | return { |
31 | 8 … | ...initialProps |
32 | 9 … | }; |
33 | 10 … | } |
@@ -41,9 +18,9 @@ | ||
41 | 18 … | <Main /> |
42 | 19 … | <NextScript /> |
43 | 20 … | </body> |
44 | 21 … | </Html> |
45 | - ) | |
22 … | + ); | |
46 | 23 … | } |
47 | 24 … | } |
48 | 25 … | |
49 | 26 … | export default MyDocument; |
Built with git-ssb-web