Skip to content

docs: read current held keys inside stable callbacks - #160

Merged
KevinVandy merged 1 commit into
mainfrom
feat-held-key-callback-docs
Sep 27, 2026
Merged

KevinVandy merged 1 commit into
mainfrom
feat-held-key-callback-docs

Conversation

@KevinVandy

Copy link
Copy Markdown
Member

🎯 Changes

Document reading current held-key state inside stable React and Preact callbacks with the existing getKeyStateTracker() API. Explain when hook values need callback dependencies, how to initialize the shared tracker, and when mouse/wheel modifier flags are sufficient (including the pinch-zoom distinction).

Related to #106. This documents an existing alternative; it does not add a ref-return API or close the feature request.

Validation: full pnpm test passed with Nx caching disabled (152 tasks and the 12 KB size budget), pnpm run test:pr passed, docs links and formatting passed, and all four new examples typechecked against the built React/Preact adapters using their automatic JSX runtimes.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: TanStack/hotkeys/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 88aa0a37-9892-4dfd-86ef-594cc81c369b

📥 Commits

Reviewing files that changed from the base of the PR and between e06d82d and 5dc4875.

📒 Files selected for processing (2)
  • docs/framework/preact/guides/key-state-tracking.md
  • docs/framework/react/guides/key-state-tracking.md
 _________________________________________________________________________
< Congratulations, you implemented a distributed single point of failure. >
 -------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new

pkg-pr-new Bot commented Sep 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@tanstack/angular-hotkeys

npm i https://pkg.pr.new/@tanstack/angular-hotkeys@160

@tanstack/hotkeys

npm i https://pkg.pr.new/@tanstack/hotkeys@160

@tanstack/hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/hotkeys-devtools@160

@tanstack/lit-hotkeys

npm i https://pkg.pr.new/@tanstack/lit-hotkeys@160

@tanstack/preact-hotkeys

npm i https://pkg.pr.new/@tanstack/preact-hotkeys@160

@tanstack/preact-hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/preact-hotkeys-devtools@160

@tanstack/react-hotkeys

npm i https://pkg.pr.new/@tanstack/react-hotkeys@160

@tanstack/react-hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/react-hotkeys-devtools@160

@tanstack/solid-hotkeys

npm i https://pkg.pr.new/@tanstack/solid-hotkeys@160

@tanstack/solid-hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/solid-hotkeys-devtools@160

@tanstack/svelte-hotkeys

npm i https://pkg.pr.new/@tanstack/svelte-hotkeys@160

@tanstack/vue-hotkeys

npm i https://pkg.pr.new/@tanstack/vue-hotkeys@160

@tanstack/vue-hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/vue-hotkeys-devtools@160

commit: 5dc4875

@KevinVandy
KevinVandy marked this pull request as ready for review September 27, 2026 19:08
@KevinVandy
KevinVandy merged commit 583674a into main Sep 27, 2026
8 of 9 checks passed
@KevinVandy
KevinVandy deleted the feat-held-key-callback-docs branch September 27, 2026 19:09
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.

1 participant