I'm building offline capabilities for my app and having trouble figuring out how to test them properly.
I'm using the net-info library wrapped in a context to provide the app with information about the devices connection status:
const Connection = ({ children })=>{ const netInfo = useNetInfo(); const { isConnected, type, } = netInfo; useEffect(()=>{ console..log(`CONNECTION ${isConnected} ${type}`); },[ isConnected, type]); return (<ConnectionContext.Provider value={{ online: netInfo.isConnected, type: netInfo.type, }}> { children }</ConnectionContext.Provider> )}
If I manually disconnect the wifi and data, the app loses its connection to the development server and stops giving me information/logs and I can't really follow what is happening.
How do I get around this?