Update State After API Response React!!!
Have you ever wondered why immediately after updating the state if it is logged, the value is undefined??
const fetchAPI = async () => {
const res = await axios.get("https://catfact.ninja/fact");
setData((previousData) => ({ ...previousData...
kheersagar.hashnode.dev2 min read