On line number 42 in src/context/KeyBindContext.tsx you're returning prevShortcuts while in the preceding line (41) you are writing into newShortcuts. I might be wrong but reading the code it seems you found a matching shortcut and are updating with the latest passed values.