From 98cf0a83116270150fabee595264dd7a848f3304 Mon Sep 17 00:00:00 2001 From: Henri Date: Mon, 4 Feb 2019 11:51:38 +0100 Subject: [PATCH] [examples] Update react jss example (#6198) This updates the react-jss example to work with the v10 alpha --- examples/with-react-jss/package.json | 4 ++-- examples/with-react-jss/pages/_document.js | 5 +++-- examples/with-react-jss/pages/index.js | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/with-react-jss/package.json b/examples/with-react-jss/package.json index 325bec2558a2f..d2835188e2d1e 100644 --- a/examples/with-react-jss/package.json +++ b/examples/with-react-jss/package.json @@ -7,10 +7,10 @@ "start": "next start" }, "dependencies": { - "next": "latest", + "next": "canary", "react": "^16.7.0", "react-dom": "^16.7.0", - "react-jss": "8.6.1" + "react-jss": "10.0.0-alpha.9" }, "license": "ISC" } diff --git a/examples/with-react-jss/pages/_document.js b/examples/with-react-jss/pages/_document.js index a18a4e9a2788b..3d7268b2e3c06 100644 --- a/examples/with-react-jss/pages/_document.js +++ b/examples/with-react-jss/pages/_document.js @@ -1,15 +1,16 @@ import React from 'react' import Document, { Head, Main, NextScript } from 'next/document' -import { SheetsRegistry, JssProvider } from 'react-jss' +import { SheetsRegistry, JssProvider, createGenerateId } from 'react-jss' export default class JssDocument extends Document { static async getInitialProps (ctx) { const registry = new SheetsRegistry() + const generateId = createGenerateId() const originalRenderPage = ctx.renderPage ctx.renderPage = () => originalRenderPage({ enhanceApp: App => props => ( - + ) diff --git a/examples/with-react-jss/pages/index.js b/examples/with-react-jss/pages/index.js index b89863e3ffa72..3d90e62f2bc55 100644 --- a/examples/with-react-jss/pages/index.js +++ b/examples/with-react-jss/pages/index.js @@ -1,5 +1,5 @@ import React from 'react' -import injectSheet from 'react-jss' +import withStyles from 'react-jss' const styles = { container: { @@ -23,4 +23,4 @@ function Index (props) { ) } -export default injectSheet(styles)(Index) +export default withStyles(styles)(Index)