Skip to content

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

Closed
@niedem

Description

@niedem

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>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions