🎯 What you'll practice: Building reusable custom hooks like useFetch and useLocalStorage.
1-B 2-B 3-B 4-B | 5 = error 6 = string 7 = function useFetch(url){const [data,setData]=useState(null);const [loading,setLoading]=useState(true);useEffect(()=>{fetch(url).then(r=>r.json()).then(setData).finally(()=>setLoading(false));},[url]);return {data,loading};} 8 = function useLocalStorage(key,init){const [val,setVal]=useState(()=>JSON.parse(localStorage.getItem(key))??init);const set=v=>{setVal(v);localStorage.setItem(key,JSON.stringify(v));};return [val,set];} 9 = Every component that needs to fetch data would otherwise repeat the same loading/error/data useState+useEffect boilerplate; extracting it once means every component just calls useFetch(url) | 10 = Store the value in useState, and in a useEffect keyed on [value, delay], set a setTimeout that updates the debounced state after "delay" ms — with a cleanup function that clears the timeout if value changes again before it fires.