docs(storage): fix unbalanced parenthesis in RESET example by DucMinhNe · Pull Request #3331 · pmndrs/jotai · GitHub
Skip to content

docs(storage): fix unbalanced parenthesis in RESET example - #3331

Merged
dai-shi merged 2 commits into
pmndrs:mainfrom
DucMinhNe:docs/storage-example-paren
Jun 10, 2026
Merged

dai-shi merged 2 commits into
pmndrs:mainfrom
DucMinhNe:docs/storage-example-paren

Conversation

@DucMinhNe

Copy link
Copy Markdown
Contributor

Summary

The RESET example in the Storage docs has a JSX snippet that doesn't parse — the setIsVisible call has an unbalanced extra closing parenthesis:

<button onClick={() => setIsVisible((prev) => prev ? RESET : true))}>Toggle visible</button>

setIsVisible( opens one paren, (prev) => is balanced, the first ) closes setIsVisible(...), and the trailing ) is unmatched. Copy-pasting it throws SyntaxError: Unexpected token (reproduced with @babel/preset-react).

Fix

Wrap the ternary in parentheses so the example parses (and reads more clearly):

<button onClick={() => setIsVisible((prev) => (prev ? RESET : true))}>Toggle visible</button>

Docs-only change.

@vercel

vercel Bot commented Jun 8, 2026 •

Copy link
Copy Markdown

@pkg-pr-new

pkg-pr-new Bot commented Jun 8, 2026 •

Copy link
Copy Markdown

@dai-shi dai-shi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@dai-shi
dai-shi merged commit 22ae563 into pmndrs:main Jun 10, 2026
45 checks passed

This branch was successfully deployed

1 active deployment
Preview — 03e0a874 Deployed Jun 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants