Element type is invalid
See original GitHub issueWhat’s happening?
Invariant Violation: 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.
Check the render method of QRCodeScanner
.
How can it be reproduced?
Build details?
“prop-types”: “^15.6.1”, “react”: “16.3.1”, “react-native”: “0.55.3”, “react-native-camera”: “^0.5.1”, “react-native-qrcode-scanner”: “^1.0.1”
windows 8
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Invariant Violation: Element type is invalid: expected a string ...
This error can rise if you try to import a non-existent component. Make sure you have no typo and that the component indeed...
Read more >(React) Element type is invalid, expected a string (for built in ...
To solve the error "Element type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got", ......
Read more >Element type is invalid: expected a string (for built-in ... - GitHub
The app breaks and gives this error message: Element type is invalid: expected a string (for built-in components) or a class/function (for ...
Read more >Element type is invalid: expected a string (for built-in ... - Reddit
Getting Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: ...
Read more >Element type is invalid: expected a string (for ... - OneCompiler
Element type is invalid : expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was able to find this page which described a few solutions: https://github.com/facebook/react-native/issues/16332
I was able to solve this by changing this line:
class ScanScreen extends Component {
to this:export default class ScanScreen extends Component {
I’ve same error:
Link to my repository for reproduce: https://github.com/matoxxx/react-native-qrcode-scanner-error