Re-calling useEffect after a failed api fetching request
问题 I am executing useEffect() to update a state with JSON data. However the fetch request sometimes fails, so I want to re-execute the useEffect hook if that happens: ... import React, {useState, useEffect} from 'react'; import {getJsonData} from './getJsonData'; const myApp = () => { var ErrorFetchedChecker = false; const [isLoading,setIsLoading] = useState(true); const [data,setData] = useState(null); const updateState = jsonData => { setIsloading(false); setData(jsonData); }; useEffect(() =>