1You can pass it as the initial param like below
2
3 <Stack.Screen
4 name="Home"
5 component={HomeScreen}
6 initialParams={{ setState: setState }}
7 />
8And access it like below
9
10function HomeScreen({ navigation, route }) {
11 return (
12 <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
13 <Button
14 title="setState"
15 onPress={() => route.params.setState(false)}
16 />
17 </View>
18 );
19}