Reactjs – State is not updating in useEffect hook
I am fetching an API and setting response data in the products array. But, the products array state is not updating and returning an empty array. here is my code, const [products, setProducts] = useState([]); useEffect(() => { const apiCaller…