Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typesafe context modals - MantineModalsOverride doesnt work #4341

Open
mpsenicka opened this issue Jun 1, 2023 · 1 comment
Open

typesafe context modals - MantineModalsOverride doesnt work #4341

mpsenicka opened this issue Jun 1, 2023 · 1 comment
Labels
TBD It is clear how to fix the issue and the fix will be provided soon

Comments

@mpsenicka
Copy link

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:
image

But even though i extend it, MantineModal type still extracts only "string" value, as shown here:
image

I think wanted behaviour is as follows:
image

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

@mpsenicka
Copy link
Author

PR: #4343

@rtivital rtivital added the TBD It is clear how to fix the issue and the fix will be provided soon label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TBD It is clear how to fix the issue and the fix will be provided soon
Projects
None yet
Development

No branches or pull requests

2 participants