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

Enhanced type defintion for withStyles #10880

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix unit test
  • Loading branch information
franklixuefei authored Apr 2, 2018
commit b0fb90313124900bc22b128b42a11b3abd458bf2
4 changes: 2 additions & 2 deletions test/typescript/styles.spec.tsx
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ const styles: StyleRulesCallback<'root'> = ({ palette, spacing }) => ({
},
});

const StyledExampleOne = withStyles(styles)<ComponentProps>(({ classes, text }) => (
const StyledExampleOne = withStyles(styles)(({ classes, text }) => (
<div className={classes.root}>{text}</div>
));
<StyledExampleOne text="I am styled!" />;
@@ -57,7 +57,7 @@ const ComponentWithChildren: React.SFC<WithStyles<ComponentClassNames>> = ({
children,
}) => <div className={classes.root}>{children}</div>;

const StyledExampleThree = withStyles(styleRule)<{}>(ComponentWithChildren);
const StyledExampleThree = withStyles(styleRule)(ComponentWithChildren);
<StyledExampleThree />;

// Also works with a plain object