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

fix(react): type issue in Dialog with OverridableComponent #294

Merged
merged 5 commits into from
Oct 21, 2024

Conversation

brionmario
Copy link
Member

@brionmario brionmario commented Oct 21, 2024

Purpose

A TS error was observed when using the Dialog component (v1.15.0)

No overload matches this call.
  Overload 1 of 2, '(props: { component: ElementType<any>; } & { component?: ElementType; } & Omit<DialogProps, "component"> & { BackdropComponent?: ElementType<BackdropProps>; ... 6 more ...; sx?: SxProps<...>; } & Omit<...> & CommonProps & Omit<...>): Element', gave the following error.
    Property 'component' is missing in type '{ children: Element[]; open: true; }' but required in type '{ component: ElementType<any>; }'.
  Overload 2 of 2, '(props: DefaultComponentProps<ModalTypeMap<"div", DialogProps<ElementType>>>): Element', gave the following error.
    Type '{ children: Element[]; open: true; }' is not assignable to type 'Omit<ModalUnstyledOwnProps, "slotProps">'.
      Types of property 'children' are incompatible.
        Type 'Element[]' is missing the following properties from type 'ReactElement<any, string | JSXElementConstructor<any>>': type, props, keyts(2769)

Related Issues

  • N/A

Related PRs

Checklist

  • Figma Board Updated. (Mandatory for Icon and Component PRs. If you don't have access, please ask the core team to update it.)
  • UX/UI review done on the final implementation.
  • Story provided. (Add screenshots)
  • Manual test round performed and verified.
  • Unit tests provided. (Add links if there are any)
  • Documentation provided. (Add links if there are any)

Security checks

savindi7
savindi7 previously approved these changes Oct 21, 2024
pavinduLakshan
pavinduLakshan previously approved these changes Oct 21, 2024
@brionmario brionmario merged commit 85d2b26 into wso2:main Oct 21, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants