TypeError: Cannot read property 'setParent' of undefined
See original GitHub issueDescribe the bug When I’m importing a Button from proton-native, and rendering it the app crashes, with the error: TypeError: Cannot read property ‘setParent’ of undefined.
To Reproduce
import { Button } from 'proton-native';
return (
<App>
<Window style={{ width: 700, height: 768, backgroundColor: 'white' }}>
<View>
<Text style={processStyle}>aksjdhahdjk</Text>
<Button>Click</Button>
</View>
</Window>
</App>
);
Expected behavior Button should be rendered with sucess.
Screenshots
Versions:
- OS: Ubuntu
- Version 19.04
- Node version v12.14.1
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'setParent' of null - Stack ...
Solved it: I was switching from a model-driven form to a template-driven form. I missed to remove one occurance of a "formControlName" on...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >TypeError: Cannot read property 'setParent' of null – iTecNote
All of a sudden this error occurs in my component: "Uncaught (in promise): TypeError: Cannot read property 'setParent' of null".
Read more >TypeError: Cannot read property 'parent' of undefined - Reddit
The error message means that some code tried to access thing.parent where thing happened to have the value undefined rather than some object....
Read more >How to fix "Cannot read properties of undefined (reading ...
I don't have a good answer for this one... I'm getting an error like this from an Angular unit tests: TypeError: Cannot read...
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
Also having the same problem on Arch linux and Node 12.14.1
As seen here, Button takes no children. To pass the text to the button, you can use the
title
prop. I’ve added an error that should make this clearer in the future.