react-modal-dialog
react-modal-dialog copied to clipboard
Cannot read property 'number' of undefined
When adding the repository with yarn add react-modal-dialog, just by importing it gives this error, as if the actual _react object is undefined within the library. Any idea of why this happens?
Edit: I believe its in the way proptypes is imported.
![screen shot 2017-10-26 at 5 10 19 pm](https://user-images.githubusercontent.com/17255298/32081132-ccc57822-ba70-11e7-82f3-810ebbc44955.png)
Yes, proptypes have changed in React 16 and the plugin no longer works
Any updates on this?
Had the same issue and created a workaround with react (v16) and the prop-types package. Not the best one, but it works:
require('react').PropTypes = require('prop-types');
still wont work
@zhangkaiyulw Are you using webpack? If so:
entry.js (used in webpack):
require('react').PropTypes = require('prop-types');
require('./client.js');
client.js (Also works with require
ofc)
import React from 'react'
import ReactDOM from 'react-dom'
// ...
ReactDOM.hydrate(...)