Skip to content

Commit

Permalink
Fixed the false value in user config getting overriden by the default…
Browse files Browse the repository at this point in the history
… value.
  • Loading branch information
deepakjosp committed Aug 9, 2024
1 parent c8d9f44 commit ba4a42e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ const useHotKeys = (hotkey, handler, userConfig, externalDocument) => {
);

const memoizedConfig = useMemo(
() =>
mergeLeft(
{ enabled: userConfig?.enabled, mode: userConfig?.mode },
DEFAULT_CONFIG
),
[userConfig?.enabled, userConfig?.mode]
() => mergeLeft(userConfig, DEFAULT_CONFIG),
[userConfig?.enabled, userConfig?.mode, userConfig?.unbindOnUnmount]
);

useEffect(() => {
Expand Down

0 comments on commit ba4a42e

Please sign in to comment.