Search code examples
cssreactjsradium

Problem with Radium while updating react from 15.4.1 to 16.8.6


While I am updating my React app from version 15.4.1 to React 16.8.6 I get the error Cannot read property 'object' of undefined at Object../node_modules/radium/lib/components How do i fix this error

 var Style = _react2.default.createClass({
  28 |   displayName: 'Style',
  29 |   propTypes: {
> 30 |     radiumConfig: _react.PropTypes.object,
  31 |     rules: _react.PropTypes.object,
  32 |     scopeSelector: _react.PropTypes.string
  33 |   },

this is what i get on my browser


Solution

  • This is because PropTypes are no longer available in React v16. You may need to update to a later version of Radium as the library has been updated to use the prop-types package from npm.

    You can see the radium change log here