How to fix Warning: useEffect received a final argument that is not an array (instead, received `[type]`). When specified, the final argument must be an array. in React | DevErrors