react-native-root-toast
react-native-root-toast copied to clipboard
Not compatible with latest versions of React Native Web
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,
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.
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?
Until the PR is merged you can install from my repo:
npm i https://github.com/mmomtchev/react-native-root-toast#deprected-prop-types