I'm trying to understand React Recoil and when an updated atom's value is available, or how to make the new value propagate vertically and horizontally across the app.
For example if I have an atom called userState
and I update one of its properties like avatar_url
, the value is not the new value if I console it right after the setUser.
const [user, setUser] = useRecoilState(userState);
setUser({ avatar_url: imageURL, ...appUser});
console.log(imageURL); // is the actual new URL
console.log(user.avatar_url); // should be new URL but isn't