Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Minor tweaks to use-local-storage page #2636

Merged
merged 1 commit into from Oct 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/src/docs/hooks/use-local-storage.mdx
Expand Up @@ -73,9 +73,9 @@ const [value, setValue, removeValue] = useLocalStorage({
## Browser tabs synchronization

use-local-storage subscribes to [storage event](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event).
When state changes in one tab it automatically updates value in all other opened browser tabs.
When state changes in one tab, it automatically updates value in all other opened browser tabs.
You can test this feature by opening 2 tabs with Mantine docs side by side and changing color scheme
(button on the top right or `⌘ + J` on mac and `Ctrl + J` on Windows and Linux).
(button on the top right or `⌘ + J` on MacOS and `Ctrl + J` on Windows and Linux).

## Serialize/deserialize json

Expand Down Expand Up @@ -132,10 +132,10 @@ interface UseLocalStorage<T> {
/** Default value that will be set if value is not found in local storage */
defaultValue?: T;

/** If set to true, value will be update is useEffect after mount */
/** If set to true, value will be update in useEffect after mount */
getInitialValueInEffect: boolean;

/** Function to serialize value into string to be save in local storage */
/** Function to serialize value into string to be saved in local storage */
serialize?(value: T): string;

/** Function to deserialize string value from local storage to value */
Expand Down