From 144e82b89dda7bea660bfe2e0b16472c477ef278 Mon Sep 17 00:00:00 2001 From: Yair Even Or Date: Sun, 10 Nov 2024 10:09:24 +0200 Subject: [PATCH 1/2] Update location.mdx Added an important warning note against instantiating `atomWithLocation` more than once in an app --- docs/extensions/location.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/extensions/location.mdx b/docs/extensions/location.mdx index d35ba767f3..aa7e2dd158 100644 --- a/docs/extensions/location.mdx +++ b/docs/extensions/location.mdx @@ -23,6 +23,9 @@ atomWithLocation(options): PrimitiveAtom `atomWithLocation` creates a new atom that links to `window.location`. +Typically, you should only instantiate atomWithLocation once per application. This is because changes made to one instance might not be reflected in others. +As this atom is designed to synchronize with the window.location object, using multiple instances can lead to unpredictable behavior. + ### Parameters **options** (optional): an object of options to customize the behavior of the atom From fa99a9849e1a2cbd73abcd33bc822623963cd156 Mon Sep 17 00:00:00 2001 From: Yair Even Or Date: Sun, 10 Nov 2024 17:10:30 +0700 Subject: [PATCH 2/2] ran `prettier` npm script and added 2 `code` annotations for the new paragraph --- docs/extensions/location.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/extensions/location.mdx b/docs/extensions/location.mdx index aa7e2dd158..62af53a381 100644 --- a/docs/extensions/location.mdx +++ b/docs/extensions/location.mdx @@ -23,8 +23,8 @@ atomWithLocation(options): PrimitiveAtom `atomWithLocation` creates a new atom that links to `window.location`. -Typically, you should only instantiate atomWithLocation once per application. This is because changes made to one instance might not be reflected in others. -As this atom is designed to synchronize with the window.location object, using multiple instances can lead to unpredictable behavior. +Typically, you should only instantiate `atomWithLocation` once per application. This is because changes made to one instance might not be reflected in others. +As this atom is designed to synchronize with the `window.location` object, using multiple instances can lead to unpredictable behavior. ### Parameters