Skip to content

Commit

Permalink
chore(OrderSummary): avoid redundant rendering upon auto-generating e…
Browse files Browse the repository at this point in the history
…lement IDs (carbon-design-system#529)
  • Loading branch information
asudoh authored and marijohannessen committed Jan 24, 2018
1 parent 6d2ddd9 commit 549363a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/components/OrderSummary/OrderSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ export class OrderSummaryHeader extends Component {
const {
children,
className,
id = `order__summary__header__id_${Math.random()
.toString(36)
.substr(2)}`,
id = (this._sectionId =
this._sectionId ||
`order__summary__header__id_${Math.random()
.toString(36)
.substr(2)}`),
title,
...other
} = this.props;
Expand Down Expand Up @@ -191,9 +193,11 @@ export class OrderSummaryFooter extends Component {
render() {
const {
className,
id = `order__summary__footer__id_${Math.random()
.toString(36)
.substr(2)}`,
id = (this._sectionId =
this._sectionId ||
`order__summary__footer__id_${Math.random()
.toString(36)
.substr(2)}`),
footerText,
linkText,
href,
Expand Down

0 comments on commit 549363a

Please sign in to comment.