Skip to content

Commit

Permalink
docs(Button): Update PropTypes and added DefaultProps (#1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbruckner authored and TheSharpieOne committed Jan 24, 2019
1 parent 71f9574 commit e8a2945
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions docs/lib/Components/ButtonsPage.js
Expand Up @@ -34,23 +34,42 @@ export default class ButtonsPage extends React.Component {
<PrismCode className="language-jsx">
{`Button.propTypes = {
active: PropTypes.bool,
'aria-label': PropTypes.string,
block: PropTypes.bool,
color: PropTypes.string, // default: 'secondary'
disabled: PropTypes.bool,
outline: PropTypes.bool,
// Pass in a Component to override default button element
// example: react-router Link
// default: 'button'
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
tag: PropTypes.oneOfType([
PropTypes.func,
PropTypes.string,
PropTypes.shape({ $$typeof: PropTypes.symbol, render: PropTypes.func }),
PropTypes.arrayOf(PropTypes.oneOfType([
PropTypes.func,
PropTypes.string,
PropTypes.shape({ $$typeof: PropTypes.symbol, render: PropTypes.func }),
]))
]),
// ref will only get you a reference to the Button component, use innerRef to get a reference to the DOM element (for things like focus management).
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
onClick: PropTypes.func,
size: PropTypes.string,
children: PropTypes.node,
className: PropTypes.string,
cssModule: PropTypes.object,
// use close prop for BS4 close icon utility
close: PropTypes.bool,
}
Button.defaultProps = {
color: 'secondary',
tag: 'button',
}`}
</PrismCode>
</pre>
Expand Down

0 comments on commit e8a2945

Please sign in to comment.