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
This library is designed with the shared state as a single source of truth first principle, but also the state can be scoped depending on the intended use.
1253
-
Scoped atoms preserve their state in the nearest [AtomScope](#atomscope)in the ancestor of the view in which the atom is used, and they are not shared outside the scope. `Scoped` is the attribute for that feature.
1253
+
Scoped atoms preserves the atom state in the [AtomScope](#atomscope)nearest to the ancestor of where it is used and prevents it from being shared out of scope. `Scoped` is the attribute for that feature.
This is also useful when multiple identical screens are stacked and each has isolated states such as user inputs.
1306
-
Note that other atoms that depend on the scoped atom will be in a shared state and must be given `Scoped` attribute as well in order to scope them as well.
1305
+
This is also useful when multiple identical screens are stacked and each screen needs isolated states such as user inputs.
1306
+
Note that other atoms that depend on scoped atoms will be in a shared state and must be given `Scoped` attribute as well in order to scope them as well.
1307
1307
1308
1308
#### Override Atoms
1309
1309
1310
-
Overriding an atom in [AtomRoot](#atomroot) or [AtomScope](#atomscope) overwrites its value when used in the descendant views, which is useful for dependency injection or swapping state in a particular view.
1310
+
Overriding an atom in [AtomRoot](#atomroot) or [AtomScope](#atomscope) overwrites its state when used in the descendant views, which is useful for dependency injection or swapping state in a particular view.
0 commit comments