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

Hello {this.props.name}!

); } } const Decorated = withWidth()(withStyles(styles)(Hello)); ; const WidthSFC = withWidth()<{ // shouldn't need to specify width here; it's a given name: string; }>(({ width, name }) =>
hello, {name}
); ;