magicismight / react-native-root-toast

react native toast like component, pure javascript solution
MIT License
2.05k stars 404 forks source link

Not compatible with latest versions of React Native Web #134

Open haveamission opened 3 years ago

haveamission commented 3 years ago

i am getting this error due to deprecated prop types:

TypeError: Cannot read property 'style' of undefined

  64 | static propTypes = {
  65 |     ...ViewPropTypes,
> 66 |     containerStyle: ViewPropTypes.style,
     | ^  67 |     duration: PropTypes.number,
  68 |     visible: PropTypes.bool,
  69 |     position: PropTypes.number,
rsml commented 3 years ago

Here's more info on the change and a suggested workaround: https://github.com/oblador/react-native-collapsible/pull/384#issue-549362196

Side note: I'm working around this by dynamically only requiring react-native-root-toast when Platform.OS !== 'web'. Instead of showing the toast, I can settle for just calling window.alert(...) on web.

elGatoMantocko commented 2 years ago

I ran into this today following the expo docs for setting up cross-platform toasts. Is there any intention to release a fix at some point?

mmomtchev commented 2 years ago

Until the PR is merged you can install from my repo:

npm i https://github.com/mmomtchev/react-native-root-toast#deprected-prop-types