New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ViewPropTypes from react-native undefined, causing TypeError on the 'style' prop #164
Comments
@sajidrocks are you using a Typescript version? |
@AugustoAleGon , thanks for looking into it. No, I am not using a Typescript version. |
Ok. Let me take a look. Can you post a snippet of the code? |
Please see below. FYI - the MultiSelect component is embedded inside a react-hook-form Controller, which is not even reached since the import triggers compilation, which fails with the error //import MultiSelect from 'react-native-multiple-select';
|
Can you please remove the node_modules folder and run I am testing right now with the latest RN version and all is looking good. |
I see what the problem is. Trying just to wrap the component around a |
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. |
Any progress on this? Is there any temporary solution other than commenting propTypes? |
Issue 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:
The text was updated successfully, but these errors were encountered: