[GH-ISSUE #269] TypeError: Cannot read property 'setParent' of undefined #184

Closed
opened 2026-05-05 11:53:33 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @giovanniKleinCampigoto on GitHub (Feb 26, 2020).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/269

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.

Originally created by @giovanniKleinCampigoto on GitHub (Feb 26, 2020). Original GitHub issue: https://github.com/kusti8/proton-native/issues/269 **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** ```jsx 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](https://user-images.githubusercontent.com/23245646/75378776-0e44c680-58b3-11ea-850d-5c4127aa26f7.png) **Versions:** - OS: Ubuntu - Version 19.04 - Node version v12.14.1 **Additional context** Add any other context about the problem here.
gitea-mirror 2026-05-05 11:53:33 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@olingern commented on GitHub (Mar 4, 2020):

Also having the same problem on Arch linux and Node 12.14.1

<!-- gh-comment-id:594432387 --> @olingern commented on GitHub (Mar 4, 2020): Also having the same problem on Arch linux and Node 12.14.1
Author
Owner

@olingern commented on GitHub (Mar 7, 2020):

Not sure why, but working from the examples I'm able to compile.

<!-- gh-comment-id:596052631 --> @olingern commented on GitHub (Mar 7, 2020): Not sure why, but working from the [examples](https://github.com/kusti8/proton-native/tree/master/examples) I'm able to compile.
Author
Owner

@jcolag commented on GitHub (Mar 11, 2020):

I'm obviously not the expert, but it looks like you may need to import { App, Button View, Text, Window } from 'proton-native' instead of just Button, to get the application running.

<!-- gh-comment-id:597819636 --> @jcolag commented on GitHub (Mar 11, 2020): I'm obviously not the expert, but it looks like you _may_ need to `import { App, Button View, Text, Window } from 'proton-native'` instead of just `Button`, to get the application running.
Author
Owner

@giovanniKleinCampigoto commented on GitHub (Mar 12, 2020):

I'm obviously not the expert, but it looks like you may need to import { App, Button View, Text, Window } from 'proton-native' instead of just Button, to get the application running.

Thanks for the heads up, but everything is imported, it's just a snippet.

<!-- gh-comment-id:598134511 --> @giovanniKleinCampigoto commented on GitHub (Mar 12, 2020): > I'm obviously not the expert, but it looks like you _may_ need to `import { App, Button View, Text, Window } from 'proton-native'` instead of just `Button`, to get the application running. Thanks for the heads up, but everything is imported, it's just a snippet.
Author
Owner

@kusti8 commented on GitHub (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.

<!-- gh-comment-id:599746458 --> @kusti8 commented on GitHub (Mar 16, 2020): As seen [here](https://reactnative.dev/docs/button), 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/proton-native#184
No description provided.