ReactJS - always abort fetch calls if you need to
Nov 1, 2022 · 2 min read · Say you have the following custom hook: export function useFectch(url){ const [loading, setLoading] = useState(true); const [data, setData] = useState(); const [error, setError] = useState(); useEffect( () => { setLoading(true); fetc...
Join discussion