import * as React from 'react'; import { Grid } from '@material-ui/core'; import { Theme, createStyles } from '@material-ui/core/styles'; import withStyles, { WithStyles } from '@material-ui/core/styles/withStyles'; import withWidth, { WithWidth } from '@material-ui/core/withWidth'; const styles = (theme: Theme) => createStyles({ root: { display: 'flex', flexDirection: 'column', backgroundColor: theme.palette.common.black, }, }); interface HelloProps extends WithWidth, WithStyles { name?: string; } export class Hello extends React.Component { static defaultProps = { name: 'Alex', }; render() { return (

Hello {this.props.name}!

); } } const Decorated = withWidth()(withStyles(styles)(Hello)); ; interface SFCProps extends WithWidth { name: string; } const WidthSFC = withWidth()(({ width, name }: SFCProps) => (
hello, {name}
)); ;