Skip to content

Commit

Permalink
[Fade] Fix propTypes not warning on missing child element
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Feb 12, 2019
1 parent 1ed6682 commit d10309b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/material-ui/src/Fade/Fade.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Fade extends React.Component {

const style = {
...styleProp,
...(React.isValidElement(children) ? children.props.style : {}),
...children.props.style,
};

return (
Expand All @@ -87,7 +87,7 @@ Fade.propTypes = {
/**
* A single child content element.
*/
children: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
children: PropTypes.element.isRequired,
/**
* If `true`, the component will transition in.
*/
Expand Down
2 changes: 1 addition & 1 deletion pages/api/fade.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The `hidden` prop will be set on the child according to the `in` prop.

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">union:&nbsp;element&nbsp;&#124;<br>&nbsp;func<br></span> |   | A single child content element. |
| <span class="prop-name required">children *</span> | <span class="prop-type">element</span> |   | A single child content element. |
| <span class="prop-name">in</span> | <span class="prop-type">bool</span> |   | If `true`, the component will transition in. |
| <span class="prop-name">timeout</span> | <span class="prop-type">union:&nbsp;number&nbsp;&#124;<br>&nbsp;{ enter?: number, exit?: number }<br></span> | <span class="prop-default">{ enter: duration.enteringScreen, exit: duration.leavingScreen,}</span> | The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object. |

Expand Down

0 comments on commit d10309b

Please sign in to comment.