Closed fpmanuel closed 1 year ago
Merging #102 (7a36e2d) into main (f146959) will not change coverage. The diff coverage is
n/a
.
:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
@@ Coverage Diff @@
## main #102 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 201 201
Branches 30 30
=========================================
Hits 201 201
Impacted Files | Coverage Δ | |
---|---|---|
src/index.tsx | 100.00% <ø> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
what's the time of publish this typing fix? I need this typing safe function in urgently.
Published in v1.2.9.
This seems like a regression to me. My modal doesn't work with this.
TS2769: No overload matches this call.
Overload 1 of 3, '(modal: FC<Props & NiceModalHocProps>, args?: Omit<Props & NiceModalHocProps, "id"> | undefined): Promise<...>', gave the following error.
Argument of type '{ title: string; content: () => JSX.Element; cancelLabel: string; }' is not assignable to parameter of type 'Omit<Props & NiceModalHocProps, "id">'.
Object literal may only specify known properties, and 'cancelLabel' does not exist in type 'Omit<Props & NiceModalHocProps, "id">'.
Overload 2 of 3, '(modal: string, args?: Record<string, unknown> | undefined): Promise<unknown>', gave the following error.
Argument of type 'FC<Props & NiceModalHocProps>' is not assignable to parameter of type 'string'.
Overload 3 of 3, '(modal: string, args: { title: string; content: () => Element; cancelLabel: string; }): Promise<unknown>', gave the following error.
Argument of type 'FC<Props & NiceModalHocProps>' is not assignable to parameter of type 'string'.
I'm trying to pass in a modal I created with NiceModal.create()
and it breaks with this change.
I'm gonna have to pin to 1.2.8 for the time being.
@fperaltalitebox would you plz take a look?
I've also had to pin to 1.2.8 to resolve this
The
show
function doesn't infer the types of the modal you are passing as first parameter. By passing a generic we can do so :surfer: