jeanregisser / react-native-slider

A pure JavaScript <Slider> component for react-native
MIT License
1.3k stars 573 forks source link

Uncaught TypeError: Cannot read property 'style' of undefined #176

Open gbhasha opened 4 years ago

gbhasha commented 4 years ago

When used with 'react-styleguidist' along with 'react-styleguidist' for documenting the react-native components, I got below error.

Uncaught TypeError: Cannot read property 'style' of undefined at eval (webpack:///./demo/node_modules/react-native-slider/lib/Slider.js?:552) at Object../demo/node_modules/react-native-slider/lib/Slider.js (main.bundle.js:4663)

The error is pointing to this line in Slider.js image

my dependencies:

"react": "16.13.0", "react-native": "0.61.5", "react-styleguidist": "11.0.3", "react-native-web": "0.12.2", "webpack": "4.42.0",

gbhasha commented 4 years ago

Something related... 'ViewPropTypes' is not supported in 'react-native-web' v12.0 onwards https://github.com/oxyii/react-native-web-swiper/issues/41

Suggested solution is to use PropTypes.shape()

ianaz commented 4 years ago

Same problem here, I'm going to try with PropTypes.shape(), thanks @gbhasha

tvriya commented 3 weeks ago

@ianaz Is the solution working?