react-toolbox / react-toolbox-themr

A tool to statically extract and generate custom themes for React Toolbox
MIT License
240 stars 24 forks source link

TypeError: Cannot read property 'shape' of undefined #61

Open sundayhd opened 7 years ago

sundayhd commented 7 years ago

Getting error when trying to see my app:

TypeError: Cannot read property 'shape' of undefined ./node_modules/react-css-themr/lib/utils/themr-shape.js C:/Projects/reacttoolboxstarter/node_modules/react-css-themr/lib/utils/themr-shape.js:7 4 | 5 | var _react = require('react'); 6 |

7 | exports.default = _react.PropTypes.shape({ 8 | theme: _react.PropTypes.object.isRequired 9 | }); 10 |

using react-toolbox-themr and react-toolbox 2.0.6 beta read everything from readme... any help?

aaahrens commented 7 years ago

Bump. Getting the same error using the default create react app and the Get Started page.

rokugou commented 7 years ago

react 16.0.0 changed the behaviour. downgrade to 15.6.2 is work for me.

aat-antoine commented 7 years ago

I confirm dowgrading to 15.6.2 works fine except theme is not applied in my case

aaahrens commented 7 years ago

The install copypasta is out of date. It says to install version beta.6, but when installing separately yarn installs version beta.12. Which makes sense considering recent the react changes are. Beta.12 works perfectly with React 16.

@aat-antoine you also import the css at the top level. I forgot that when i was starting it, might be the case.

aat-antoine commented 7 years ago

@drunkengranite same omission o_O. Thx, you are a life saver :)

jervtub commented 7 years ago

The version beta.12 indeed fixes this issue, however when I add specifically

"react-toolbox": "2.0.0-beta.12"

the old typing is still used. Is the updated version add to npm?