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

[DialogContent] Add missing dividers class types #18984

Merged
merged 1 commit into from
Dec 26, 2019
Merged

[DialogContent] Add missing dividers class types #18984

merged 1 commit into from
Dec 26, 2019

Conversation

NickCis
Copy link
Contributor

@NickCis NickCis commented Dec 26, 2019

According to the docs. Dialog Content could receive a dividers attribute in the classes property. Current type definitions only allows for a root attribute, which causes the following error if a dividers attribute in the classes property is passed:

TS2769: No overload matches this call.
  Overload 1 of 2, '(props: DialogContentProps, context?: any): ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<...>)> | Component<...> | null', gave the following error.
    Type '{ dividers: string; }' is not assignable to type 'Partial<Record<"root", string>>'.
      Object literal may only specify known properties, and 'dividers' does not exist in type 'Partial<Record<"root", string>>'.
  Overload 2 of 2, '(props: PropsWithChildren<DialogContentProps>, context?: any): ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<...>)> | null) | (new (props: any) => Component<...>)> | Component<...> | null', gave the following error.
    Type '{ dividers: string; }' is not assignable to type 'Partial<Record<"root", string>>'.
      Object literal may only specify known properties, and 'dividers' does not exist in type 'Partial<Record<"root", string>>'.

This PR adds the dividers attribute to typescript type definition of the classes property.

@NickCis NickCis changed the title Fixed dividers css property for DialogContent DialogContent: dividers classes property (typescript definition) Dec 26, 2019
@mui-pr-bot
Copy link

No bundle size changes comparing f7a2c42...0f72a2d

Generated by 🚫 dangerJS against 0f72a2d

@oliviertassinari oliviertassinari changed the title DialogContent: dividers classes property (typescript definition) [DialogContent] Add missing dividers class types Dec 26, 2019
@oliviertassinari oliviertassinari added component: dialog This is the name of the generic UI component, not the React module! typescript labels Dec 26, 2019
@oliviertassinari oliviertassinari merged commit 6c628f4 into mui:master Dec 26, 2019
@oliviertassinari
Copy link
Member

@NickCis It's a great first pull request on Material-UI 👌🏻. Thank you for working on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dialog This is the name of the generic UI component, not the React module! typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants