fix(step-keys): Use description slice for key

This commit is contained in:
Stuart Taylor
2017-12-28 18:56:24 +00:00
parent def690b282
commit a3a9683bf7

View File

@@ -177,13 +177,13 @@ export class StepChallenge extends PureComponent {
step, step,
stepBackward, stepBackward,
stepForward stepForward
}, index) { }) {
if (!Array.isArray(step)) { if (!Array.isArray(step)) {
return null; return null;
} }
const [imgUrl, imgAlt, info, action] = step; const [imgUrl, imgAlt, info, action] = step;
return ( return (
<div key={ `${imgUrl}-step-wrapper-${index}` }> <div key={ `${info.slice(0, 15)}` }>
<a <a
href={ imgUrl } href={ imgUrl }
onClick={ clickOnImage } onClick={ clickOnImage }
@@ -241,8 +241,8 @@ export class StepChallenge extends PureComponent {
if (!Array.isArray(steps)) { if (!Array.isArray(steps)) {
return null; return null;
} }
return steps.map(([ imgUrl, imgAlt ], index) => ( return steps.map(([ imgUrl, imgAlt, info ]) => (
<div key={ `${imgUrl}-images-wrapper-${index}` }> <div key={ `${info.slice(0, 15)}` }>
<Image <Image
alt={ imgAlt } alt={ imgAlt }
responsive={ true } responsive={ true }