本页还没有译文
本页 8 段还没译成Tiếng Việt,下面显示的是英文原文。useHotkeyRegistrations
还没翻译译自英文(tanstack.com)本页 8 段都还没译
function useHotkeyRegistrations(): HotkeyRegistrationsResult;Defined in: useHotkeyRegistrations.ts:54
React hook that reactively reads all hotkey and sequence registrations from the singleton managers.
This is a standalone hook that does NOT require the HotkeysProvider. It subscribes to both HotkeyManager and SequenceManager stores and re-renders when registrations change.
Returns
Object with hotkeys and sequences arrays
Example
function ShortcutPalette() {
const { hotkeys, sequences } = useHotkeyRegistrations()
return (
<ul>
{hotkeys.map((reg) => (
<li key={reg.id}>
{reg.options.meta?.name ?? reg.hotkey}
</li>
))}
{sequences.map((reg) => (
<li key={reg.id}>
{reg.options.meta?.name ?? reg.sequence.join(' ')}
</li>
))}
</ul>
)
}AI 翻译查看英文原文