You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, if you build your app for Release, it will work as expected.
518
518
519
-
### Now what?
519
+
## 7. Passing initial props to the React Native view
520
+
521
+
In some case, you'd like to pass some information from the Native app to JavaScript. For example, you might want to pass the user id of the currently logged user to React Native, together with a token that can be used to retrieve information from a database.
522
+
523
+
This is possible by using the `initialProperties` parameter of the `view(withModuleName:initialProperty)` overload of the `RCTReactNativeFactory` class. The following steps shows you how to do it.
524
+
525
+
### Update the App.tsx file to read the initial properties.
526
+
527
+
Open the `App.tsx` file and add the following code:
These changes will tell React Native that your App component is now accepting some properties. The `RCTreactNativeFactory` will take care of passing them to the component when it's rendered.
594
+
595
+
### Update the Native code to pass the initial properties to JavaScript.
At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.
0 commit comments