react-d3 / react-d3-basic

Basic d3 charts in React.js, only include: line, bar, pie, scatter, area charts.
http://reactd3.org/docs/basic
221 stars 117 forks source link

React.PropTypes is deprecated #52

Open rafkhan-wg opened 6 years ago

rafkhan-wg commented 6 years ago

https://reactjs.org/docs/typechecking-with-proptypes.html

jseminck commented 6 years ago

It seems like these repos are not maintained anymore:

"A solution for building reusable components for d3 charts, NOT MAINTAINED."

zmiller346 commented 6 years ago

To get the files to work, you need to go into any applicable or broken file, and add:

var PropTypes = require('prop-types'); var createReactClass = require('create-react-class');

To the top along with any other require statements, then you have to change the create class line to:

module.exports = createReactClass({

And finally, go to any instance of PropTypes with React in front of it (not things like createElement, keep those the same), and remove the React. or _react. in front of it. It's kind of tedious, but I got it all working with that.