React Navigation - How to calling function from another file and use it on headerRight onPress?
问题 I wonder there's a way to using headerRight onPress to doing something like calling Alert : I have a function inside MyPet.js with the code : _alert=()=>{ alert('saving') } and in router.js I have a list of all screen I've used to navigating with a piece of code like : export const MyPatientStack = StackNavigator({ MyPatient: { screen: MyPatient, navigationOptions: { tabBarLabel: 'My Patient', tabBarIcon: ({ tintColor, focused }) => <FontAwesome name="wheelchair" size={25} color={tintColor} /