title: TypeScript: Interface cannot simultaneously extends two types
body: <p>I'm writing a React app using TypeScript. I use material-ui for my components. I'm writing a custom wrapper for material-ui's Button component. It looks like this:</p>
  
  <pre><code>import MUIButton, { ButtonProps } from "@material-ui/core/Button";
  import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
  import classNames from "classnames";
  import React, { PureComponent } from "react";
  import styles from "./styles";
  
  export interface OwnProps {
    color: "primary" | "danger" | "warning" | "transparent";
    size: "sm" | "lg";
  }
  
  export interface Props
    extends WithStyles&lt;typeof styles&gt;,
      OwnProps,
      ButtonProps {}
  
  export class Button extends PureComponent&lt;Props&gt; {
    render() {
      const { color, size, classes, children, ...rest } = this.props;
      const btnClasses = classNames({
        [classes.button]: true,
        [classes[size]]: size,
        [classes[color]]: color
      });
      return (
        &lt;MUIButton {...rest} className={btnClasses}&gt;
          {children}
        &lt;/MUIButton&gt;
      );
    }
  }
  
  export default withStyles(styles)(Button);
  </code></pre>
  
  <p>The problem is that here that the definition of Props throw the error message:</p>
  
  <pre><code>Named property 'color' of types 'OwnProps' and 'ButtonProps' are not identical.
  [ts]
  Interface 'Props' cannot simultaneously extend types 'OwnProps' and 'ButtonProps'.
    Named property 'size' of types 'OwnProps' and 'ButtonProps' are not identical.
  Named property 'color' of types 'OwnProps' and 'ButtonProps' are not identical.
  [ts]
  Interface 'Props' cannot simultaneously extend types 'OwnProps' and 'ButtonProps'.
    Named property 'size' of types 'OwnProps' and 'ButtonProps' are not identical.
  </code></pre>
  
  <p>This error goes away if I instead write:</p>
  
  <pre><code>export class Button extends PureComponent&lt;Props &amp; ButtonProps&gt; {
  </code></pre>
  
  <p>But then when using the Button the props color and size throw the error:</p>
  
  <pre><code>The expected type comes from property 'color' which is declared here on type 'IntrinsicAttributes &amp; Pick&lt;Props &amp; ButtonProps, ...
  </code></pre>
  
  <p>How can I correctly tell the component that it has the the Props I defined (<code>OwnProps</code>) as well as the props that come from the Button as usual?</p>