Setting State in Useeffect Hook
Advertisements I want to set my state to an array of objects, my code is correctly populating an empty from the the fetched data but I am not able to set my state to that data. Below is my code: const [postMItems, setPostMItems] = useState([]); let existingM = [] useEffect(() => { const fetchMItems =… Read More Setting State in Useeffect Hook