Skip to content

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 scope: dialog Changes related to the dialog. 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

scope: dialog Changes related to the dialog. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants