xotahal / react-native-material-ui

Highly customizable material design components for React Native
MIT License
3.78k stars 609 forks source link

PropTypes are deprecated (and make the library crash with react-native-web) #500

Open alessiocancian opened 3 years ago

alessiocancian commented 3 years ago

This library uses deprecated propTypes from react-native which aren't exported by react-native-web (https://github.com/necolas/react-native-web/issues/1543).

As a result when trying to use react-native-material-ui on web I got this error:

Uncaught TypeError: Cannot read property 'style' of undefined
   at eval(webpack-internal:///./node_modules/react-native-material-ui/src/IconToggle/IconToggle.react.js)
   at Object../node_modules/react-native-material-ui/src/IconToggle/IconToggle.react.js
   ....

I'm sending a PR with the patch I used to fix it...

samaneh-kamalian commented 3 years ago

This library uses deprecated propTypes from react-native which aren't exported by react-native-web (necolas/react-native-web#1543).

As a result when trying to use react-native-material-ui on web I got this error:

Uncaught TypeError: Cannot read property 'style' of undefined
   at eval(webpack-internal:///./node_modules/react-native-material-ui/src/IconToggle/IconToggle.react.js)
   at Object../node_modules/react-native-material-ui/src/IconToggle/IconToggle.react.js
   ....

I'm sending a PR with the patch I used to fix it...

same problem!

samaneh-kamalian commented 3 years ago

Excuse me, I have a serious problem with this. Is there no solution?

alessiocancian commented 3 years ago

Excuse me, I have a serious problem with this. Is there no solution?

Yes, you can patch the package using patch-package, see my PR with the fix