How to reset/rerender screen you just left with react navigation
Set unmountOnBlur
to true
Unmounting a screen resets any local state in the screen as well as the state of the nested navigators in the screen. Defaults to
false
.
<Tab.Navigator
screenOptions={{ unmountOnBlur: true }}
>
...
</Tab.Navigator>
Also, you can apply it to a single route:
<Tab.Navigator>
<Tab.Screen name="..." component={...} options={{ unmountOnBlur: true }} />
</Tab.Navigator>