When I use react-native-web
, my App entry looks like the following
AppRegistry.registerComponent('SnsAdvertiser', () => Advertiser)
AppRegistry.runApplication('SnsAdvertiser', { rootTag: document.getElementById('mainApp') });
I wonder how I can pass props to the root Component in this case Advertiser
in this case in a web environment.
runApplication
accepts another parameter in the second argument called initialProps
alongwith rootTag
AppRegistry.runApplication('SnsAdvertiser', {
rootTag: document.getElementById('mainApp'),
initialProps: {...}
});