Skip to content

Instantly share code, notes, and snippets.

@doppio
Created October 10, 2017 18:00
Show Gist options
  • Select an option

  • Save doppio/8c401064ef0fe7f9d009f869c3bc626a to your computer and use it in GitHub Desktop.

Select an option

Save doppio/8c401064ef0fe7f9d009f869c3bc626a to your computer and use it in GitHub Desktop.
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