tomauty / react-native-chart

[NOT MAINTAINED] :bar_chart: Add line, area, pie, and bar charts to your React Native app
http://tomauty.github.io/react-native-chart
MIT License
1.57k stars 238 forks source link

PropTypes imported via React/React-Native has been deprecated #182

Open aliv1 opened 6 years ago

aliv1 commented 6 years ago

Needs to be imported via as the third party component prop-types. import PropTypes from 'prop-types' Please update.

DavitVosk commented 6 years ago

I faced the same problem here. How can I fix the problem?

vtam311 commented 6 years ago

I was able to fix it. Here's what I did.

I forked the project and opened up the src files.

In each source file, whenever PropTypes was used, I changed how PropTypes was imported.

Before: import { PropTypes } from 'react'

Now: import PropTypes from 'prop-types';

The package uses the dist files in our project, so to update the dist files, do this in your fork. npm install npm run build.

Then push the changes to your fork on Github, and require your github repo instead of this repo in your project.

In package.json, add the line "react-native-chart": "github:{YOUR_USERNAME}/react-native-chart",