diff --git a/.changeset/react-ancestor-ref-before-act.md b/.changeset/react-ancestor-ref-before-act.md deleted file mode 100644 index 4b721b9e3..000000000 --- a/.changeset/react-ancestor-ref-before-act.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/react-hotkeys': patch ---- - -A hotkey whose `target` is a ref on an ancestor element now registers before Testing Library's `render()` returns. Since 0.27.4 it registered a microtask later, so a test that pressed a key right after `render()` saw nothing happen. diff --git a/examples/react/keyboard-layouts/package.json b/examples/react/keyboard-layouts/package.json index aa5bf1b3a..a1de6e140 100644 --- a/examples/react/keyboard-layouts/package.json +++ b/examples/react/keyboard-layouts/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "react": "^19.3.1", "react-dom": "^19.3.1" }, diff --git a/examples/react/kitchen-sink/package.json b/examples/react/kitchen-sink/package.json index 12ea9f03c..3f3d22160 100644 --- a/examples/react/kitchen-sink/package.json +++ b/examples/react/kitchen-sink/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "@tanstack/react-router": "^1.170.46", "react": "^19.3.1", "react-dom": "^19.3.1" diff --git a/examples/react/scopes/package.json b/examples/react/scopes/package.json index 54e1e5623..fa466749e 100644 --- a/examples/react/scopes/package.json +++ b/examples/react/scopes/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "react": "^19.3.1", "react-dom": "^19.3.1" }, diff --git a/examples/react/useFormatForDisplay-astro/package.json b/examples/react/useFormatForDisplay-astro/package.json index 3438af201..f561fdc37 100644 --- a/examples/react/useFormatForDisplay-astro/package.json +++ b/examples/react/useFormatForDisplay-astro/package.json @@ -22,7 +22,7 @@ "dependencies": { "@astrojs/node": "^11.1.11", "@astrojs/react": "^7.1.4", - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "astro": "^7.4.7", "react": "^19.3.1", "react-dom": "^19.3.1" diff --git a/examples/react/useFormatForDisplay-nextjs/package.json b/examples/react/useFormatForDisplay-nextjs/package.json index a8a45fddf..117b045f2 100644 --- a/examples/react/useFormatForDisplay-nextjs/package.json +++ b/examples/react/useFormatForDisplay-nextjs/package.json @@ -20,7 +20,7 @@ } }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "next": "^16.4.5", "react": "^19.3.1", "react-dom": "^19.3.1" diff --git a/examples/react/useFormatForDisplay-react-router/package.json b/examples/react/useFormatForDisplay-react-router/package.json index 37c5e107e..8492cdfcf 100644 --- a/examples/react/useFormatForDisplay-react-router/package.json +++ b/examples/react/useFormatForDisplay-react-router/package.json @@ -22,7 +22,7 @@ "dependencies": { "@react-router/node": "^8.5.1", "@react-router/serve": "^8.5.1", - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "isbot": "^5.2.3", "react": "^19.3.1", "react-dom": "^19.3.1", diff --git a/examples/react/useFormatForDisplay-tanstack-start/package.json b/examples/react/useFormatForDisplay-tanstack-start/package.json index 5b8000a29..f853ddb70 100644 --- a/examples/react/useFormatForDisplay-tanstack-start/package.json +++ b/examples/react/useFormatForDisplay-tanstack-start/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "@tanstack/react-router": "^1.170.46", "@tanstack/react-start": "^1.169.5", "react": "^19.3.1", diff --git a/examples/react/useHeldKeys/package.json b/examples/react/useHeldKeys/package.json index db0a144f6..4ea818a18 100644 --- a/examples/react/useHeldKeys/package.json +++ b/examples/react/useHeldKeys/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "react": "^19.3.1", "react-dom": "^19.3.1" }, diff --git a/examples/react/useHotkey-sequences/package.json b/examples/react/useHotkey-sequences/package.json index d48a151ff..1a97bbe54 100644 --- a/examples/react/useHotkey-sequences/package.json +++ b/examples/react/useHotkey-sequences/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "react": "^19.3.1", "react-dom": "^19.3.1" }, diff --git a/examples/react/useHotkey/package.json b/examples/react/useHotkey/package.json index fb658443b..947d2ab61 100644 --- a/examples/react/useHotkey/package.json +++ b/examples/react/useHotkey/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "react": "^19.3.1", "react-dom": "^19.3.1" }, diff --git a/examples/react/useHotkeyRecorder-sequences/package.json b/examples/react/useHotkeyRecorder-sequences/package.json index 0a7eb654a..5b0154e0f 100644 --- a/examples/react/useHotkeyRecorder-sequences/package.json +++ b/examples/react/useHotkeyRecorder-sequences/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "react": "^19.3.1", "react-dom": "^19.3.1" }, diff --git a/examples/react/useHotkeyRecorder/package.json b/examples/react/useHotkeyRecorder/package.json index f1610a922..92e0276aa 100644 --- a/examples/react/useHotkeyRecorder/package.json +++ b/examples/react/useHotkeyRecorder/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "react": "^19.3.1", "react-dom": "^19.3.1" }, diff --git a/examples/react/useHotkeys-sequences/package.json b/examples/react/useHotkeys-sequences/package.json index da0a253db..3107a7a8f 100644 --- a/examples/react/useHotkeys-sequences/package.json +++ b/examples/react/useHotkeys-sequences/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "react": "^19.3.1", "react-dom": "^19.3.1" }, diff --git a/examples/react/useHotkeys/package.json b/examples/react/useHotkeys/package.json index 3a23d724f..e3ee6e0e2 100644 --- a/examples/react/useHotkeys/package.json +++ b/examples/react/useHotkeys/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "react": "^19.3.1", "react-dom": "^19.3.1" }, diff --git a/examples/react/useKeyLockState/package.json b/examples/react/useKeyLockState/package.json index 6713a811d..81d6de974 100644 --- a/examples/react/useKeyLockState/package.json +++ b/examples/react/useKeyLockState/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "react": "^19.3.1", "react-dom": "^19.3.1" }, diff --git a/examples/react/useKeyhold/package.json b/examples/react/useKeyhold/package.json index 84cb09925..8a958ef9d 100644 --- a/examples/react/useKeyhold/package.json +++ b/examples/react/useKeyhold/package.json @@ -11,7 +11,7 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-hotkeys": "^0.29.5", + "@tanstack/react-hotkeys": "^0.29.6", "react": "^19.3.1", "react-dom": "^19.3.1" }, diff --git a/packages/react-hotkeys/CHANGELOG.md b/packages/react-hotkeys/CHANGELOG.md index b7021080a..65f801d2e 100644 --- a/packages/react-hotkeys/CHANGELOG.md +++ b/packages/react-hotkeys/CHANGELOG.md @@ -1,5 +1,11 @@ # @tanstack/react-hotkeys +## 0.29.6 + +### Patch Changes + +- [#329](https://github.com/TanStack/hotkeys/pull/329) [`45e5b7c`](https://github.com/TanStack/hotkeys/commit/45e5b7c8ad9a73c5d14fbc7ea66d5b01fd6aed41) - A hotkey whose `target` is a ref on an ancestor element now registers before Testing Library's `render()` returns. Since 0.27.4 it registered a microtask later, so a test that pressed a key right after `render()` saw nothing happen. + ## 0.29.5 ### Patch Changes diff --git a/packages/react-hotkeys/package.json b/packages/react-hotkeys/package.json index cc021841e..5a3c61720 100644 --- a/packages/react-hotkeys/package.json +++ b/packages/react-hotkeys/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/react-hotkeys", - "version": "0.29.5", + "version": "0.29.6", "description": "React adapter for TanStack Hotkeys", "author": "Tanner Linsley", "license": "MIT",