JackDanielsAndCode / react-native-multi-slider

Pure JS react native slider component with one or two markers.
MIT License
151 stars 96 forks source link

PropTypes.bool #50

Open RDMCharts opened 6 years ago

RDMCharts commented 6 years ago

Hi guys, I have been trying to get the multislider to work with my React Native project. However whenever I try to import the multislider I receive an error message, Undefined is not an object (evaluating 'PropTypes.bool') it only shows up when I have used: import MultiSlider from 'react-native-mulit-slider'; at the top of my project.

Any advice of what I am doing wrong would be amazing!

Thanks

timorss commented 6 years ago

@RDMCharts send the code please

mickadoua commented 6 years ago

same problem
only the import, crash the app,

import MultiSlider from "react-native-multi-slider";

package Version :

"react": "16.0.0", 
"react-native": 50.3

its maybe, proptype implementation var { PropTypes } = React; on mockProps.js and Slider.js files

mickadoua commented 6 years ago

@RDMCharts try to change on both files by

var PropTypes = require('prop-types');

peterchibunna commented 6 years ago

Changing the problematic statements resulted to a new error: undefined is not a function (evaluating '_react3.default.createClass') with a pointer to the line 12 of mockProps.js var BasicMarker = React.createClass({

atturnbull commented 6 years ago

Hey, figured out a fix. Do as above suggests, and additionally change every line of

var <className> = React.createClass({

to

var <className> = React.Component({

React.createClass() has been deprecated for a while now, I guess. Replacing it to just extend the React.Component class got me past this error. Hope it works for you too.

Edit: This being said, the upkeep on this repo is pretty dead. We may want to switch to https://github.com/ptomasroos/react-native-multi-slider , who seems to be updating more regularly