Created
October 10, 2017 18:00
-
-
Save doppio/8c401064ef0fe7f9d009f869c3bc626a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from "react"; | |
| import { StyleRules, withStyles, WithStyles } from "material-ui/styles"; | |
| import Typography from "material-ui/typography"; | |
| type ClassNames = "text"; | |
| const styles: StyleRules<ClassNames> = { | |
| text: { | |
| color: "blue" | |
| } | |
| } | |
| interface IProps { | |
| someText: string; | |
| } | |
| class MyComponent extends React.Component<IProps & WithStyles<ClassNames>> { | |
| public render() { | |
| return ( | |
| <Typography type="body1" classes={{ root: this.props.classes.text }}> | |
| { this.props.someText } | |
| </Typography> | |
| ); | |
| } | |
| } | |
| export default withStyles<ClassNames>(styles)<IProps>(MyComponent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment