Skip to content

Commit

Permalink
[test] Add undesired withStyles + generic props component behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Apr 5, 2019
1 parent 496b0ff commit f57812b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/material-ui/test/typescript/styles.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { ThemeProvider } from '@material-ui/styles';
import Button from '@material-ui/core/Button';
import { blue } from '@material-ui/core/colors';
import { StandardProps } from '@material-ui/core';
import { StandardProps, ButtonBase } from '@material-ui/core';

// Shared types for examples
interface ComponentProps extends WithStyles<typeof styles> {
Expand Down Expand Up @@ -463,3 +463,17 @@ withStyles(theme =>
// Property 'nonDefaulted' is missing in type '{}'
const MissingPropUsage = () => <StyledMyButton />; // $ExpectError
}

// https://github.com/mui-org/material-ui/issues/14586
{
const styles = createStyles({
root: {
color: 'red',
},
});

const StyledButton = withStyles(styles)(Button);

// undesired
<StyledButton component="a" />; // $ExpectError
}

0 comments on commit f57812b

Please sign in to comment.