diff --git a/docs/guides/performance.mdx b/docs/guides/performance.mdx index bed9709eab..8a6d364e0f 100644 --- a/docs/guides/performance.mdx +++ b/docs/guides/performance.mdx @@ -55,7 +55,7 @@ Dont's: ```jsx const Profile = () => { const [name] = useAtom(nameAtom) - const [ageAtom] = useAtom(ageAtom) + const [age] = useAtom(ageAtom) return ( <>
{name}
diff --git a/docs/utilities/storage.mdx b/docs/utilities/storage.mdx index e274b4f287..b35054e31e 100644 --- a/docs/utilities/storage.mdx +++ b/docs/utilities/storage.mdx @@ -142,7 +142,8 @@ const storedAtom = atomWithStorage('stored-key', content, storage) #### Notes with AsyncStorage (since v2.2.0) -If you use any kinds of AsyncStorage, the atom value can become async. Hence, if you are to update the value, you need to possibly resolve the promise. +With AsyncStorage (as with any asynchronous storage), the atom value becomes async. +When updating the atom by referencing the current value, then you'll need to `await` it. ```js const countAtom = atomWithStorage('count-key', 0, anyAsyncStorage)