Skip to content

Commit

Permalink
migration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
adidahiya committed Feb 16, 2021
1 parent 07b4dca commit 02b4539
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
15 changes: 15 additions & 0 deletions packages/core/src/components/hotkeys/hotkeys-target2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
@# HotkeysTarget2

<div class="@ns-callout @ns-intent-primary @ns-icon-info-sign">
<h4 class="@ns-heading">

Migrating from [HotkeysTarget](#core/components/hotkeys)?

</h4>

HotkeysTarget2 is a replacement for HotkeysTarget. You are encouraged to use this new API, or
the `useHotkeys` hook directly in your function components, as they will be come the standard
APIs in Blueprint v4. See the full
[migration guide](https://github.com/palantir/blueprint/wiki/useHotkeys-migration) on the wiki.

</div>


The `HotkeysTarget2` component is a utility component which allows you to use the new
[`useHotkeys` hook](#core/hooks/useHotkeys) inside a React component class. It's useful
if you want to switch to the new hotkeys API without refactoring your class components
Expand Down
16 changes: 15 additions & 1 deletion packages/core/src/hooks/useHotkeys.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,23 @@ tag: new

@# useHotkeys

<div class="@ns-callout @ns-intent-primary @ns-icon-info-sign">
<h4 class="@ns-heading">

Migrating from [HotkeysTarget](#core/components/hotkeys)?

</h4>

`useHotkeys` is a replacement for HotkeysTarget. You are encouraged to use this new API in your function
components, or the HotkeysTarget2 component in your component classes, as they will be come the standard
APIs in Blueprint v4. See the full
[migration guide](https://github.com/palantir/blueprint/wiki/useHotkeys-migration) on the wiki.

</div>

The `useHotkeys` hook adds hotkey / keyboard shortcut interactions to your application using a custom React hook.
Compared to the deprecated [Hotkeys](#core/components/hotkeys) API, it works with function components and allows
more customization of the explanatory hotkeys dialog.
more customization of the hotkeys dialog.

@reactExample UseHotkeysExample

Expand Down

1 comment on commit 02b4539

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

migration docs

Previews: documentation | landing | table

Please sign in to comment.