const [user, setUser] = useEffect({});
useEffect(() => {
fetch(`/api/users/${id}`)
.then(resp => resp.json())
.then(setUser);
}, []);
I was watching a tutorial and saw the above code. In the last line of useEffect, the then function is simply taking in the setUser function and NOT CALLING IT. Why isn't the last line .then(setUser(value))?
Please help clearify this...