Browse Source

adjusting the use of async function within useEffect

master
Joselito Lima 1 year ago
parent
commit
97e0b29c9b
  1. 5
      src/App.js

5
src/App.js

@ -50,7 +50,8 @@ export default function App() {
}); });
} }
useEffect(async () => {
useEffect(() => {
async function getNetInfo() {
if (netInfo.isInternetReachable) { if (netInfo.isInternetReachable) {
const cachedForms = await cache.get("sendforms"); const cachedForms = await cache.get("sendforms");
if (!isReconnected) { if (!isReconnected) {
@ -81,6 +82,8 @@ export default function App() {
notImplemented(colors.blueWarning, "Sem conexão à internet", null, false); notImplemented(colors.blueWarning, "Sem conexão à internet", null, false);
setIsReconnected(false); setIsReconnected(false);
} }
}
getNetInfo()
}, [netInfo.isInternetReachable]); }, [netInfo.isInternetReachable]);
useEffect(() => { useEffect(() => {

Loading…
Cancel
Save