git ssb

0+

Rômulo Alves / website



Commit 0b5cc6b028dd8f3199b4203e8f44c9bc54b35b65

fixes

romuloalves committed on 4/17/2021, 11:07:51 PM
Parent: 04f1928b97e35d5d5fe0cd9c216f1e431a121f33

Files changed

.babelrcchanged
package-lock.jsonchanged
package.jsonchanged
pages/_document.tsxchanged
.babelrcView
@@ -1,4 +1,3 @@
11 {
2- "presets": ["next/babel"],
3- "plugins": [["styled-components", { "ssr": true }]]
2 + "presets": ["next/babel"]
43 }
package-lock.jsonView
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.jsonView
@@ -18,15 +18,12 @@
1818 "next": "^10.1.3",
1919 "next-seo": "^4.24.0",
2020 "react": "^17.0.2",
2121 "react-dom": "^17.0.2",
22- "styled-components": "^5.2.3",
2322 "styled-jsx": "^3.4.4"
2423 },
2524 "devDependencies": {
2625 "@types/node": "^14.14.37",
2726 "@types/react": "^17.0.3",
28- "@types/styled-components": "^5.1.9",
29- "babel-plugin-styled-components": "^1.12.0",
3027 "typescript": "^4.2.4"
3128 }
3229 }
pages/_document.tsxView
@@ -1,33 +1,10 @@
11 import Document, { Html, Head, Main, NextScript } from 'next/document';
2-import { ServerStyleSheet } from 'styled-components';
32
43 class MyDocument extends Document {
54 static async getInitialProps(ctx) {
6- const sheet = new ServerStyleSheet();
7- const originalRenderPage = ctx.renderPage;
85 const initialProps = await Document.getInitialProps(ctx);
96
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-
307 return {
318 ...initialProps
329 };
3310 }
@@ -41,9 +18,9 @@
4118 <Main />
4219 <NextScript />
4320 </body>
4421 </Html>
45- )
22 + );
4623 }
4724 }
4825
4926 export default MyDocument;

Built with git-ssb-web