nit: fix perf regression in hotkeys (#10302)
Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
import {useMemo} from 'react'
|
||||
|
||||
export function Provider({children}: {children: React.ReactNode}) {
|
||||
return children
|
||||
}
|
||||
|
||||
const noop = () => {}
|
||||
|
||||
export function useHotkeysContext() {
|
||||
return {
|
||||
enableScope: () => {},
|
||||
disableScope: () => {},
|
||||
}
|
||||
return useMemo(
|
||||
() => ({
|
||||
enableScope: noop,
|
||||
disableScope: noop,
|
||||
}),
|
||||
[],
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user