Force Refresh (Reload) Screen on Screen Change with React Navigation Tab in React Native

Tiempo de lectura: < 1 minuto

Reading time: < 1 minute

If we want to force a screen to reload when it changes or is opened again in React Native, follow these steps:

In our screen stack, add the following property:

options={{unmountOnBlur: true}}

By adding this property, unmountOnBlur will unmount the component and remount it every time we open it, ensuring that the screen is refreshed.

This property only works in React Navigation Tab:

 <Tab.Screen name="Menu" component={Menu} options={{unmountOnBlur: true}} />

Leave a Comment