getHotkeyHandler
typing seems off
#5705
Labels
Fixed patch
Completed issues that will be published with next patch (1.0.X)
getHotkeyHandler
typing seems off
#5705
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.5.1
What package has an issue?
@mantine/core
What framework do you use?
create-react-app (CRA)
In which browsers you can reproduce the issue?
All
Describe the bug
Hi 👋🏼
When using the basic example from the
useHotkeys
documentation here, but just makinghotkeys
a const in the component and passing it togetHotkeyHandler
, like so:.. then the following error is shown:
Argument of type 'import("/...node_modules/@mantine/hooks/lib/use-hotkeys/use-hotkeys").HotkeyItem[]' is not assignable to parameter of type 'HotkeyItem[]'.
This looks similar to #4404 but the mitigation doesn't seem to be working, as the official example shows.
I couldn't find a way to make the error disappear, even by trying to type everything correctly (event and the like).
Thanks a lot!
If possible, include a link to a codesandbox with a minimal reproduction
No response
Possible fix
It seems
HotkeyItem
is defined twice, but differently in your code : here, not exported, here and exported, and they seem to be conflicting if I understand correctly?Self-service
The text was updated successfully, but these errors were encountered: