“The final argument passed to useEffect changed size between renders”, except I don’t think it does?

If you have a

useEffect(() => {}, itemArray)

and you modify itemArray, you will get this error. this is probably just a typo. I did this when I had a list of items I was using from state. It didn’t catch it because it was an array. You need [] around the itemArray.

useEffect(() => {}, [itemArray])

The real issue is that your dependency array changed size, not that you added another item to your array. fix this typo and you should be fine.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)