diff --git a/examples/with-rebass/.babelrc b/examples/with-rebass/.babelrc deleted file mode 100644 index d9c3f919cedb..000000000000 --- a/examples/with-rebass/.babelrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "presets": ["next/babel"], - "plugins": [ - [ - "styled-components", - { "ssr": true, "displayName": true, "preprocess": false } - ] - ] -} diff --git a/examples/with-rebass/package.json b/examples/with-rebass/package.json index d5fd2bd64cd0..bf29745bfe27 100644 --- a/examples/with-rebass/package.json +++ b/examples/with-rebass/package.json @@ -7,14 +7,7 @@ }, "dependencies": { "next": "latest", - "react": "^18.0.0", - "react-dom": "^18.0.0", - "rebass": "^4.0.7", - "styled-components": "^5.3.0" - }, - "devDependencies": { - "babel-plugin-styled-components": "^2.0.7", - "babel-plugin-transform-object-assign": "^6.22.0", - "babel-plugin-transform-object-set-prototype-of-to-assign": "^6.22.0" + "react": "^18.2.0", + "react-dom": "^18.2.0" } } diff --git a/examples/with-rebass/pages/_document.js b/examples/with-rebass/pages/_document.js deleted file mode 100644 index 2734d4e2736b..000000000000 --- a/examples/with-rebass/pages/_document.js +++ /dev/null @@ -1,18 +0,0 @@ -import { Html, Head, Main, NextScript } from 'next/document' -import { ServerStyleSheet } from 'styled-components' - -export default function Document() { - const sheet = new ServerStyleSheet() - const main = sheet.collectStyles(
) - const styleTags = sheet.getStyleElement() - - return ( - - {styleTags} - -
{main}
- - - - ) -} diff --git a/examples/with-strict-csp/pages/_document.js b/examples/with-strict-csp/pages/_document.js index c65a84322801..f85a7eaeb7ea 100644 --- a/examples/with-strict-csp/pages/_document.js +++ b/examples/with-strict-csp/pages/_document.js @@ -6,13 +6,13 @@ const cspHashOf = (text) => { hash.update(text) return `'sha256-${hash.digest('base64')}'` } -export default function Document() { +export default function Document(ctx) { let csp = `default-src 'self'; script-src 'self' ${cspHashOf( - NextScript.getInlineScriptSource(this.props) + NextScript.getInlineScriptSource(ctx) )}` if (process.env.NODE_ENV !== 'production') { csp = `style-src 'self' 'unsafe-inline'; font-src 'self' data:; default-src 'self'; script-src 'unsafe-eval' 'self' ${cspHashOf( - NextScript.getInlineScriptSource(this.props) + NextScript.getInlineScriptSource(ctx) )}` }