rsnext/examples/with-react-with-styles/package.json
Mohsen Azimi c67908c9a5
Upgrade react-with-styles to version 4 (#13193)
Currently failing because `withStyles` can't read the interface from context:


```
Unhandled Runtime Error
TypeError: Cannot read property 'createLTR' of undefined
webpack-internal:///./node_modules/react-with-styles/lib/withStyles.js (150:33)
```

Manually registering the interface resolves the issue:

```diff
diff --git a/examples/with-react-with-styles/pages/_app.js b/examples/with-react-with-styles/pages/_app.js
index 91d09a2a9..a393572b8 100644
--- a/examples/with-react-with-styles/pages/_app.js
+++ b/examples/with-react-with-styles/pages/_app.js
@@ -2,11 +2,16 @@ import App from 'next/app'
 import React from 'react'
 import WithStylesContext from 'react-with-styles/lib/WithStylesContext'
 import AphroditeInterface from 'react-with-styles-interface-aphrodite'
+import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet'
 
 import defaultTheme from '../defaultTheme'
 
 class MyApp extends App {
+    constructor(props) {
+        super(props);
+        ThemedStyleSheet.registerInterface(AphroditeInterface)
+    }
   render() {
     const { Component, pageProps } = this.props
```

But that's not how it is documented. I'm following up with react-with-styles to see if this is a bug.
2020-05-22 17:54:36 +00:00

19 lines
426 B
JSON

{
"name": "with-react-with-styles",
"version": "1.0.0",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
"aphrodite": "^1.2.5",
"next": "latest",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-with-direction": "^1.3.1",
"react-with-styles": "^4.1.0",
"react-with-styles-interface-aphrodite": "^6.0.1"
},
"license": "MIT"
}