React Native Navigation pass dynamic data when rendering

You can try this:

<Stack.Screen name="Settings">
   { () => <SettingsScreen darkT={!!this.state.darkTheme} changeTheme={this.changeTheme} /> }
</Stack.Screen>

In the Settings screen darkT and changeTheme will be available as props so you can access with this.props.darkT and this.props.changeTheme

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top