#1313 Fixed missing ref re-assignment for conditionally rendered elements#1314
Merged
JohannesKlauss merged 4 commits intoMay 1, 2026
Conversation
# It helps re-assigning ref to conditionally rendered elements # Fixes JohannesKlauss#1313
|
@oleksandr-danylchenko is attempting to deploy a commit to the Johannes Klauss' projects Team on Vercel. A member of the Team first needs to authorize it. |
zeorin
suggested changes
Feb 5, 2026
Contributor
zeorin
left a comment
There was a problem hiding this comment.
Implement a ref callback cleanup.
oleksandr-danylchenko
added a commit
to oleksandr-danylchenko/react-hotkeys-hook
that referenced
this pull request
Feb 5, 2026
08156d4 to
7a6fc14
Compare
zeorin
approved these changes
Feb 10, 2026
Contributor
zeorin
left a comment
There was a problem hiding this comment.
Apart from my remaining comment about explicitly importing RefCallback as a type, LGTM!
oleksandr-danylchenko
added a commit
to oleksandr-danylchenko/react-hotkeys-hook
that referenced
this pull request
Feb 10, 2026
7a6fc14 to
24a08f9
Compare
24a08f9 to
e2063ea
Compare
mergify Bot
pushed a commit
to doxynix/doxynix
that referenced
this pull request
May 4, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@tanstack/eslint-plugin-query](https://tanstack.com/query) ([source](https://redirect.github.com/TanStack/query/tree/HEAD/packages/eslint-plugin-query)) | [`5.100.6` → `5.100.7`](https://renovatebot.com/diffs/npm/@tanstack%2feslint-plugin-query/5.100.6/5.100.7) |  |  | | [@tanstack/react-query](https://tanstack.com/query) ([source](https://redirect.github.com/TanStack/query/tree/HEAD/packages/react-query)) | [`5.100.6` → `5.100.7`](https://renovatebot.com/diffs/npm/@tanstack%2freact-query/5.100.6/5.100.7) |  |  | | [@tanstack/react-query-devtools](https://tanstack.com/query) ([source](https://redirect.github.com/TanStack/query/tree/HEAD/packages/react-query-devtools)) | [`5.100.6` → `5.100.7`](https://renovatebot.com/diffs/npm/@tanstack%2freact-query-devtools/5.100.6/5.100.7) |  |  | | [react-hotkeys-hook](https://react-hotkeys-hook.vercel.app/) ([source](https://redirect.github.com/JohannesKlauss/react-keymap-hook)) | [`5.2.4` → `5.3.0`](https://renovatebot.com/diffs/npm/react-hotkeys-hook/5.2.4/5.3.0) |  |  | --- ### Release Notes <details> <summary>TanStack/query (@​tanstack/eslint-plugin-query)</summary> ### [`v5.100.7`](https://redirect.github.com/TanStack/query/blob/HEAD/packages/eslint-plugin-query/CHANGELOG.md#51007) [Compare Source](https://redirect.github.com/TanStack/query/compare/@tanstack/eslint-plugin-query@5.100.6...@tanstack/eslint-plugin-query@5.100.7) </details> <details> <summary>TanStack/query (@​tanstack/react-query)</summary> ### [`v5.100.7`](https://redirect.github.com/TanStack/query/blob/HEAD/packages/react-query/CHANGELOG.md#51007) [Compare Source](https://redirect.github.com/TanStack/query/compare/@tanstack/react-query@5.100.6...@tanstack/react-query@5.100.7) ##### Patch Changes - Updated dependencies \[]: - [@​tanstack/query-core](https://redirect.github.com/tanstack/query-core)@​5.100.7 </details> <details> <summary>TanStack/query (@​tanstack/react-query-devtools)</summary> ### [`v5.100.7`](https://redirect.github.com/TanStack/query/blob/HEAD/packages/react-query-devtools/CHANGELOG.md#51007) [Compare Source](https://redirect.github.com/TanStack/query/compare/@tanstack/react-query-devtools@5.100.6...@tanstack/react-query-devtools@5.100.7) ##### Patch Changes - docs(devtools): align logo, panel, and 'buttonPosition' union descriptions across docs and JSDoc ([#​10617](https://redirect.github.com/TanStack/query/pull/10617)) - Updated dependencies \[]: - [@​tanstack/query-devtools](https://redirect.github.com/tanstack/query-devtools)@​5.100.7 - [@​tanstack/react-query](https://redirect.github.com/tanstack/react-query)@​5.100.7 </details> <details> <summary>JohannesKlauss/react-keymap-hook (react-hotkeys-hook)</summary> ### [`v5.3.0`](https://redirect.github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v5.3.0) [Compare Source](https://redirect.github.com/JohannesKlauss/react-keymap-hook/compare/v5.2.4...v5.3.0) #### What's Changed - chore(deps): update dependency vite to v7.3.2 \[security] by [@​renovate](https://redirect.github.com/renovate)\[bot] in [JohannesKlauss/react-hotkeys-hook#1321](https://redirect.github.com/JohannesKlauss/react-hotkeys-hook/pull/1321) - fix: prevent mod hotkey from triggering on Super/Windows key on non-macOS platforms by [@​samhoseinkhani](https://redirect.github.com/samhoseinkhani) in [JohannesKlauss/react-hotkeys-hook#1325](https://redirect.github.com/JohannesKlauss/react-hotkeys-hook/pull/1325) - Update all non-major dependencies by [@​renovate](https://redirect.github.com/renovate)\[bot] in [JohannesKlauss/react-hotkeys-hook#1326](https://redirect.github.com/JohannesKlauss/react-hotkeys-hook/pull/1326) - [#​1313](https://redirect.github.com/JohannesKlauss/react-keymap-hook/issues/1313) Fixed missing `ref` re-assignment for conditionally rendered elements by [@​oleksandr-danylchenko](https://redirect.github.com/oleksandr-danylchenko) in [JohannesKlauss/react-hotkeys-hook#1314](https://redirect.github.com/JohannesKlauss/react-hotkeys-hook/pull/1314) - Add Key Blacklist Support to useRecordHotkeys by [@​vedmakk](https://redirect.github.com/vedmakk) in [JohannesKlauss/react-hotkeys-hook#1268](https://redirect.github.com/JohannesKlauss/react-hotkeys-hook/pull/1268) - Update dependency [@​eslint/js](https://redirect.github.com/eslint/js) to v10 by [@​renovate](https://redirect.github.com/renovate)\[bot] in [JohannesKlauss/react-hotkeys-hook#1327](https://redirect.github.com/JohannesKlauss/react-hotkeys-hook/pull/1327) #### New Contributors - [@​samhoseinkhani](https://redirect.github.com/samhoseinkhani) made their first contribution in [JohannesKlauss/react-hotkeys-hook#1325](https://redirect.github.com/JohannesKlauss/react-hotkeys-hook/pull/1325) - [@​oleksandr-danylchenko](https://redirect.github.com/oleksandr-danylchenko) made their first contribution in [JohannesKlauss/react-hotkeys-hook#1314](https://redirect.github.com/JohannesKlauss/react-hotkeys-hook/pull/1314) - [@​vedmakk](https://redirect.github.com/vedmakk) made their first contribution in [JohannesKlauss/react-hotkeys-hook#1268](https://redirect.github.com/JohannesKlauss/react-hotkeys-hook/pull/1268) **Full Changelog**: <JohannesKlauss/react-hotkeys-hook@v5.2.4...v5.3.0> </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/Moscow) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://redirect.github.com/renovatebot/renovate).
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #1313
Relations
This PR is a revival of the #1132 initially suggested by @zeorin.
Changes Made
refwith the reactive state. Its set state function acts as a "ref callback", causing the keyboard listeners to re-attach on the conditional element's rendering.