Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotkeys v2 with hooks #4532

Merged
merged 10 commits into from
Feb 18, 2021
Prev Previous commit
fix compilation
  • Loading branch information
adidahiya committed Feb 18, 2021
commit b35b86993b80a4800b57af9e4f5e006e85e2d23c
5 changes: 4 additions & 1 deletion packages/core/src/context/hotkeys/hotkeysProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ const initialHotkeysState: HotkeysContextState = { hotkeys: [], isDialogOpen: fa
const noOpDispatch: Dispatch<HotkeysAction> = () => null;

// we can remove this guard once Blueprint depends on React 16
export const HotkeysContext = createContext?.([initialHotkeysState, noOpDispatch]);
export const HotkeysContext = createContext?.<[HotkeysContextState, Dispatch<HotkeysAction>]>([
initialHotkeysState,
noOpDispatch,
]);

const hotkeysReducer = (state: HotkeysContextState, action: HotkeysAction) => {
switch (action.type) {
Expand Down