ViewPropTypes from react-native undefined, causing TypeError on the 'style' prop
See original GitHub issueIssue summary
react-native-multi-select.js is failing to compile with TypeError: Cannot read property ‘style’ of undefined. The error appears to be for any reference made to ViewPropTypes. I have run ‘yarn outdated’ to check my node module versions and dependencies; nothing wrong stood out for me.
My app is built/run using “react-app-rewired start” with a few customize-cra rules in the config-overrides.js.
Any help/idea would be appreciated.
Library versions
react: ^17.0.1 react-native: 0.63.3 react-native-multiple-select: ^0.5.6
Steps to Reproduce
This error shows up for “import MultiSelect from ‘react-native-multiple-select’” line in my code when “react-app-rewired start” is run.
Expected Behavior
I expected ViewPropTypes.style from react-native to not cause any problems, and the multiple select list would show up in my app.
Actual Behavior
Commenting out all the lines that reference ViewPropTypes.style bypasses the compilation issue, but obviously that’s not desirable. For example, these lines:
In react-native-multi-select.js
styleDropdownMenu: ViewPropTypes.style,
styleDropdownMenuSubsection: ViewPropTypes.style,
styleInputGroup: ViewPropTypes.style,
styleItemsContainer: ViewPropTypes.style,
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Related StackOverflow Question
Any progress on this? Is there any temporary solution other than commenting propTypes?
Following your suggestions, I removed the node_modules folder and ran yarn, first with a View wrapping the component and then without the View but I am afraid to say, in both of these cases, it made no difference for me. Same error. Thanks so much for continuing to look into it.