From b088881a5d307b35c90f437b854b0fae13312db8 Mon Sep 17 00:00:00 2001 From: Lukas Polak Date: Tue, 14 Jul 2020 15:26:30 +0200 Subject: [PATCH] update/with-react-jss (#15156) Use hooks with jss --- examples/with-react-jss/package.json | 6 +++--- examples/with-react-jss/pages/index.js | 16 +++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/with-react-jss/package.json b/examples/with-react-jss/package.json index a6f6e946d0..d0f2ac79ba 100644 --- a/examples/with-react-jss/package.json +++ b/examples/with-react-jss/package.json @@ -8,9 +8,9 @@ }, "dependencies": { "next": "latest", - "react": "^16.7.0", - "react-dom": "^16.7.0", - "react-jss": "10.0.0-alpha.9" + "react": "^16.13.1", + "react-dom": "^16.13.1", + "react-jss": "^10.3.0" }, "license": "ISC" } diff --git a/examples/with-react-jss/pages/index.js b/examples/with-react-jss/pages/index.js index 759fb5ae74..f8bafce6da 100644 --- a/examples/with-react-jss/pages/index.js +++ b/examples/with-react-jss/pages/index.js @@ -1,6 +1,6 @@ -import withStyles from 'react-jss' +import { createUseStyles } from 'react-jss' -const styles = { +const useStyles = createUseStyles({ container: { marginTop: 100, textAlign: 'center', @@ -10,16 +10,18 @@ const styles = { fontSize: 24, lineHeight: 1.25, }, -} +}) + +function Index() { + const classes = useStyles() -function Index(props) { return ( -
-

+
+

Example on how to use react-jss with Next.js

) } -export default withStyles(styles)(Index) +export default Index -- GitLab