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

Type errors with Fab and Button components from core when installing latest versions of material-ui/core #15075

Closed
1 task done
zamiang opened this issue Mar 27, 2019 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@zamiang
Copy link

zamiang commented Mar 27, 2019

Seeing type errors with the Button and Fab components when installing the latest version of material-ui/core

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

No type errors

Current Behavior 😯

node_modules/@material-ui/core/Button/Button.d.ts:5:18 - error TS2430: Interface 'ButtonProps' incorrectly extends interface 'Pick<ButtonBaseProps, "disabled" | "media" | "hidden" | "dir" | "form" | "slot" | "style" | "title" | "value" | "id" | "onError" | "name" | "type" | "color" | "target" | "download" | ... 262 more ... | "TouchRippleProps"> & StyledComponentProps<...> & { ...; }'.
  Type 'ButtonProps' is not assignable to type 'Pick<ButtonBaseProps, "disabled" | "media" | "hidden" | "dir" | "form" | "slot" | "style" | "title" | "value" | "id" | "onError" | "name" | "type" | "color" | "target" | "download" | ... 262 more ... | "TouchRippleProps">'.
    Types of property 'type' are incompatible.
      Type 'string | undefined' is not assignable to type '"button" | "reset" | "submit" | undefined'.
        Type 'string' is not assignable to type '"button" | "reset" | "submit" | undefined'.

5 export interface ButtonProps extends StandardProps<ButtonBaseProps, ButtonClassKey, 'component'> {
                   ~~~~~~~~~~~

node_modules/@material-ui/core/Fab/Fab.d.ts:5:18 - error TS2430: Interface 'FabProps' incorrectly extends interface 'Pick<ButtonBaseProps, "disabled" | "media" | "hidden" | "dir" | "form" | "slot" | "style" | "title" | "value" | "id" | "onError" | "name" | "type" | "color" | "target" | "download" | ... 262 more ... | "TouchRippleProps"> & StyledComponentProps<...> & { ...; }'.
  Type 'FabProps' is not assignable to type 'Pick<ButtonBaseProps, "disabled" | "media" | "hidden" | "dir" | "form" | "slot" | "style" | "title" | "value" | "id" | "onError" | "name" | "type" | "color" | "target" | "download" | ... 262 more ... | "TouchRippleProps">'.
    Types of property 'type' are incompatible.
      Type 'string | undefined' is not assignable to type '"button" | "reset" | "submit" | undefined'.
        Type 'string' is not assignable to type '"button" | "reset" | "submit" | undefined'.

5 export interface FabProps extends StandardProps<ButtonBaseProps, FabClassKey, 'component'> {
                   ~~~~~~~~

Steps to Reproduce 🕹

Apologies I don't have a live example, but I just installed the latest version in my app and the issue appears

Context 🔦

Your Environment 🌎

Tech Version
Material-UI v3.9.2
React 16.8.5
TypeScript 3.3.4000
@eps1lon eps1lon added component: button This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information typescript component: Fab The React component. labels Mar 27, 2019
@eps1lon
Copy link
Member

eps1lon commented Mar 27, 2019

Apologies I don't have a live example, but I just installed the latest version in my app and the issue appears

This issue is not actionable without example code.

@eps1lon
Copy link
Member

eps1lon commented Mar 27, 2019

Probably duplicate of #15076

@zamiang
Copy link
Author

zamiang commented Mar 27, 2019

Yes it is exactly the same issue - we were writing the issue at almost exactly the same time.

Pinning the react types to an earlier version in my project fixed the issue for me.

@karlbohlmark
Copy link
Contributor

Sent a PR with a fix: #15077

@oliviertassinari oliviertassinari added duplicate This issue or pull request already exists and removed component: button This is the name of the generic UI component, not the React module! component: Fab The React component. status: waiting for author Issue with insufficient information typescript labels Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants