ReactReact热键钩-React开发

时间:2024-06-16 09:42:01
【文件属性】:

文件名称:ReactReact热键钩-React开发

文件大小:206KB

文件格式:ZIP

更新时间:2024-06-16 09:42:01

React Miscellaneous

MouseReact Hotkeys挂钩ReactReact Hotkeys挂钩通过NPM安装的React挂钩:yarn add reakeys然后在您的组件中,只需添加useHotkeys挂钩并指定您的密钥,例如:import React,{FC} from'react'; 从'reakeys'导入{useHotkeys}; export const YourComponent:FC =()=> {useHotkeys([{name:'Dashboard',keys:'mod + shift + d',category:'Navigation',callback:event => {event.preventDefault();历史.push('/ dashboard');}}


【文件预览】:
reakeys-master
----rollup.config.js(962B)
----.github()
--------stale.yml(684B)
--------ISSUE_TEMPLATE.md(2KB)
--------FUNDING.yml(71B)
--------PULL_REQUEST_TEMPLATE.md(991B)
--------workflows()
----yarn.lock(497KB)
----src()
--------Hotkey.story.tsx(3KB)
--------index.ts(64B)
--------useHotkeyState.ts(1KB)
--------useHotkeys.ts(599B)
----babel.config.js(563B)
----.storybook()
--------main.js(111B)
--------preview.js(52B)
--------manager.js(141B)
----tsconfig.json(997B)
----LICENSE(11KB)
----.prettierrc(149B)
----README.md(4KB)
----.editorconfig(704B)
----.gitignore(985B)
----package.json(3KB)

网友评论