access initialparams react native functional component
You can pass it as the initial param like below
  <Stack.Screen
    name="Home"
    component={HomeScreen}
    initialParams={{ setState: setState }}
  />
And access it like below
function HomeScreen({ navigation, route }) {
  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Button
        title="setState"
        onPress={() => route.params.setState(false)}
      />
    </View>
  );
}
