Skip to content

Commit

Permalink
feat(CardBody): add innerRef to CardBody (#1318)
Browse files Browse the repository at this point in the history
Fixes #1314
  • Loading branch information
bpas247 authored and TheSharpieOne committed Dec 12, 2018
1 parent 506c46a commit 4b0474f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/CardBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const propTypes = {
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
className: PropTypes.string,
cssModule: PropTypes.object,
innerRef: PropTypes.oneOfType([
PropTypes.object,
PropTypes.string,
PropTypes.func,
]),
};

const defaultProps = {
Expand All @@ -17,6 +22,7 @@ const CardBody = (props) => {
const {
className,
cssModule,
innerRef,
tag: Tag,
...attributes
} = props;
Expand All @@ -26,7 +32,7 @@ const CardBody = (props) => {
), cssModule);

return (
<Tag {...attributes} className={classes} />
<Tag {...attributes} className={classes} ref={innerRef} />
);
};

Expand Down

0 comments on commit 4b0474f

Please sign in to comment.