You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// When the user is not logged in, I set his sign to emptyconstUserSign=atomWithStorage<string|null>('user_sign',null)// hooksconstuseLogin=()=>{const[sign,setSign]=useAtom(UserSign)console.log('sign::',sign)constlogin=async()=>{awaitgetUserToken()setSign('user sign token')}useEffect(()=>{// It always triggers the first time. // In my opinion, when there is no content in storage, // it has an initial value, and when there is content, the initial value should not be returned.if(sign===null){login()}},[sign])}
Other
initialValue in atomWithStorage should not be required.
The third parameter is not required either.
I can't get around the second point when I only need to modify getOnInit:true in options.
The text was updated successfully, but these errors were encountered:
Summary
Other
The text was updated successfully, but these errors were encountered: