React Memoization, Memoization, Reactjs, React, 100daysofcode.
sessionStorage.getItem(endpoint); if (cachedData) { setData(JSON.parse(cachedData)); } else { fetch(endpoint) .then((response) => response.json()) .then((newData) => { setData(newData); sessionStorage.setItem(endpoint, JSON.stringify(newData)); }); } }, [endpoint]); return ( <div> <h1>API