Skip to content

Commit

Permalink
well done
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 10, 2018
1 parent e9f6447 commit 2a5ba0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/src/pages/layout/breakpoints/RenderPropsWithWidth.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import toRenderProps from 'recompose/toRenderProps';

const WithWidth = toRenderProps(withWidth());

function WithWidthDemo() {
function RenderPropsWithWidth() {
return (
<WithWidth>
{({ width }) => <Typography variant="subtitle1">Current width: {width}</Typography>}
</WithWidth>
);
}

export default WithWidthDemo;
export default RenderPropsWithWidth;
6 changes: 3 additions & 3 deletions docs/src/pages/layout/breakpoints/breakpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ In the following demo, we change the rendered DOM element (*em*, <u>u</u>, ~~del

⚠️ `withWidth()` server-side rendering support is limited.

## Render Props
### Render Props

In some cases you could have prop name collisions using higher-order components.
In those cases you can use [render props](https://reactjs.org/docs/render-props.html) like in the following demo.
In some cases, you could have property name collisions using higher-order components.
To avoid the issue, you can use the [render props](https://reactjs.org/docs/render-props.html) pattern like in the following demo.

{{"demo": "pages/layout/breakpoints/RenderPropsWithWidth.js"}}

Expand Down

0 comments on commit 2a5ba0d

Please sign in to comment.