Element type is invalid
wolfingduck opened this issue ยท 5 comments
Hello,
I try to use the library in my app, but when I run I get this message:
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
I also tried to import into my APP with this line: import CountryPicker from "react-native-country-codes-picker ";
but in this case I get this message: Error: text strings must be displayed inside a component.
Has anyone encountered the same problem?
Can you help me?
Probably you use pure react-native then your application don't recognize jsx prefixes. So you should add them in your config.
Try this solution: https://stackoverflow.com/questions/43031126/jsx-not-allowed-in-files-with-extension-js-with-eslint-config-airbnb
Thanks for the reply,
but this tip doesn't work for me.
I created my app with expo and added functionality to read .jsx files in my configuration
I've also tried renaming the .jsx files to .js but it still doesn't work.
Do you need to add another library?
Tks
Please provide your code and we will see...
react-native-country-picker-modal.zip
Hello,
I have attached my sample code.
This is the simple blank application.
Thank you for your help
The best way to find the issue just send the screenshots of code with some short description. This way will be much faster than diging in your project)