Is there any way to simulate airplane mode in the iPhone Simulator?
Easier hack : make a function checking the connection
import NetInfo from '@react-native-community/netinfo';
export const ckeckIsConnected = async () => {
const isConnected = NetInfo.fetch().then((state) => {
return state.isConnected;
});
return isConnected;
};
Do your data fetching only if there is connection.
To simulate no connection, just return false
to this function whatever the real connection is.