Skip to content

Commit

Permalink
feat(expandablecard): add new optional key prop
Browse files Browse the repository at this point in the history
  • Loading branch information
kajalex committed Oct 14, 2024
1 parent d88aeb7 commit df9dc52
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/sage-react/lib/ExpandableCard/ExpandableCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const ExpandableCard = ({
children,
className,
headerContent,
key,
name,
onClick,
sageType,
Expand All @@ -32,7 +33,7 @@ export const ExpandableCard = ({
}
};

const id = uuid();
const id = key || uuid();

const containerClassnames = classnames(
'sage-expandable-card',
Expand Down Expand Up @@ -99,6 +100,7 @@ ExpandableCard.defaultProps = {
children: null,
className: null,
headerContent: null,
key: null,
alignTrigger: 'middle',
name: null,
onClick: null,
Expand All @@ -110,6 +112,7 @@ ExpandableCard.propTypes = {
alignArrowRight: PropTypes.bool,
bodyBordered: PropTypes.bool,
headerContent: PropTypes.node,
key: PropTypes.string,
expanded: PropTypes.bool,
className: PropTypes.string,
children: PropTypes.node,
Expand Down

0 comments on commit df9dc52

Please sign in to comment.