mantine
mantine copied to clipboard
typesafe context modals - MantineModalsOverride doesnt work
What package has an issue
@mantine/modals
Describe the bug
I am trying to let typescript hint me names of context modals, as listed in this chapter.
By providing modals override through MantineModalsOverride interface, i successfully extend modals by "testOverride", as shown in picture below:
But even though i extend it, MantineModal type still extracts only "string" value, as shown here:
I think wanted behaviour is as follows:
Do you have an idea on how to solve this? Or am i doing something wrong?
What version of @mantine/hooks page do you have in package.json?
6.0.10
If possible, please include a link to a codesandbox with the reproduced problem
https://codesandbox.io/s/musing-lehmann-wbj8lp?file=/src/App.tsx
Do you know how to fix the issue
No
Are you willing to participate in fixing this issue and create a pull request with the fix
Yes
Possible fix
Don't check whether overrides structure has modals property, just let user override it as he would like. Typically if someone changes d.ts files, he usually knows what he's doing
PR: https://github.com/mantinedev/mantine/pull/4343
Fixed in #6443