question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'setParent' of undefined

See original GitHub issue

Describe 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 Captura de tela de 2020-02-26 16-12-41

Versions:

  • OS: Ubuntu
  • Version 19.04
  • Node version v12.14.1

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
olingerncommented, Mar 4, 2020

Also having the same problem on Arch linux and Node 12.14.1

1reaction
kusti8commented, Mar 16, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found