Skip to content

Commit

Permalink
[docs] Improve the withTheme example (#12428)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Aug 6, 2018
1 parent 901affa commit 63b23ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/src/pages/customization/themes/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ const theme = createMuiTheme({

### `withTheme()(Component) => Component`

Provide the `theme` object as a property of the input component.
Provide the `theme` object as a property of the input component so it can be used
in the render method.

#### Arguments

Expand All @@ -442,7 +443,11 @@ Provide the `theme` object as a property of the input component.
#### Examples

```js
import { withTheme } from '@material-ui/core/styles'
import { withTheme } from '@material-ui/core/styles';

function MyComponent(props) {
return <div>{props.theme.direction}</div>;
}

export default withTheme()(MyComponent);
```

0 comments on commit 63b23ee

Please sign in to comment.