Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Android) Problems passing props from native code to javascript #25660

Closed
niedem opened this issue Jul 15, 2019 · 0 comments
Closed

(Android) Problems passing props from native code to javascript #25660

niedem opened this issue Jul 15, 2019 · 0 comments
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@niedem
Copy link

niedem commented Jul 15, 2019

I tried passing a prop from android native code to react-native, on the startup. However, even after copying the exact code from the docs it failed to work.

React Native version: 0.60.3

Steps To Reproduce

  1. Created a completely blank project
  2. Added the code from the docs
  3. Started the app

Describe what you expected to happen:
A text should appear in the app, however all i got was a blank space.

Snack, code example, or link to a repository:
In my MainActivity.java, under my ReactActivityDelegate:

@Override protected Bundle getLaunchOptions() { Bundle initialProperties = new Bundle(); initialProperties.putString("testString", "This should be displayed now"); return initialProperties; }

In the render method of my app.js:

<Text>{this.props.testString}</Text>

@niedem niedem added the Bug label Jul 15, 2019
@react-native-bot react-native-bot added the Platform: Android Android applications. label Jul 15, 2019
@niedem niedem closed this as completed Jul 16, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Oct 8, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants