Skip to content

Commit

Permalink
feat(Card) : add innerRef to Card (#1082) (#1093)
Browse files Browse the repository at this point in the history
  • Loading branch information
illiteratewriter authored and TheSharpieOne committed Jun 25, 2018
1 parent d6b1ca9 commit d0bbd7a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Card.js
Expand Up @@ -12,6 +12,11 @@ const propTypes = {
outline: PropTypes.bool,
className: PropTypes.string,
cssModule: PropTypes.object,
innerRef: PropTypes.oneOfType([
PropTypes.object,
PropTypes.string,
PropTypes.func,
]),
};

const defaultProps = {
Expand All @@ -28,6 +33,7 @@ const Card = (props) => {
inverse,
outline,
tag: Tag,
innerRef,
...attributes
} = props;
const classes = mapToCssModules(classNames(
Expand All @@ -39,7 +45,7 @@ const Card = (props) => {
), cssModule);

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

Expand Down

0 comments on commit d0bbd7a

Please sign in to comment.