Skip to content

Commit

Permalink
feat(responsive): Allow children to be either a node or a function
Browse files Browse the repository at this point in the history
Also removed the xs breakpoint
  • Loading branch information
lzcabrera committed Nov 15, 2017
1 parent e569fce commit 77bd464
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Responsive/Responsive.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Responsive.propTypes = {
/**
* The content. Can be text, any HTML element, or any component.
*/
children: PropTypes.node.isRequired,
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
}

Responsive.defaultProps = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Responsive/Responsive.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Using the `minWidth` and `maxWidth` props, you can pass a breakpoint key. They r

```jsx
<div>
<Responsive minWidth="xs" maxWidth="md">
<Responsive minWidth="sm" maxWidth="md">
<Heading level="h1">Hello I'm a heading in XS and SM</Heading>
</Responsive>
<Responsive minWidth="md" maxWidth="lg">
Expand Down

0 comments on commit 77bd464

Please sign in to comment.