oblador / react-native-collapsible

Animated collapsible component for React Native, good for accordions, toggles etc
MIT License
2.44k stars 451 forks source link

ViewPropTypes.style is depricated #355

Open soroushm opened 4 years ago

soroushm commented 4 years ago

I,m using this amazing app on my hybrid app ios, android and web(PWA) but Unfortunately, ViewPropTypes now is deprecated on react-native-web as mention on the link below react-native-web releases: 0.12.0

reason

Remove prop types exports from package. These are deprecated in React Native and introduce significant DEV time performance cost. Flow types are now preferred (1ad1693)

error

TypeError: Cannot read property 'style' of undefined
./mobiletrader/node_modules/react-native-collapsible/Collapsible.js
node_modules/react-native-collapsible/Collapsible.js:16
  13 |   enablePointerEvents: PropTypes.bool,
  14 |   duration: PropTypes.number,
  15 |   easing: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
> 16 |   style: ViewPropTypes.style,
     | ^  17 |   onAnimationEnd: PropTypes.func,
  18 |   children: PropTypes.node,
  19 | };
View compiled

solution

so we have an option to use react-style-proptype package or remove it

Silventino commented 4 years ago

Same error here :( Really annoying that react-native-web just removed something that was not removed from react-native and broke a lot of packages... hope this PR get merged soon