Skip to content

Commit dc70650

Browse files
robatronnkudo
authored andcommitted
Silence unique-key errors (#13)
1 parent e14056e commit dc70650

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/area.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ export default class Area extends Component {
3232
return (
3333
<g>
3434
{
35-
dataset.map((area) => {
35+
dataset.map((area, i) => {
3636
return (
3737
<path
3838
className={`${areaClassName} area`}
3939
fill={area.color}
4040
d={that._setAxes(area.data)}
4141
style={area.style}
42+
key={i}
4243
/>
4344
)
4445
})

src/components/bar.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default class Bar extends Component {
5252
return (
5353
<g>
5454
{
55-
dataset.data.map((bar) => {
55+
dataset.data.map((bar, i) => {
5656
return (
5757
<rect
5858
className={`${barClassName} bar`}
@@ -64,6 +64,7 @@ export default class Bar extends Component {
6464
style={Object.assign({}, dataset.style, bar._style)}
6565
onMouseOut={that.triggerOut.bind(this, bar)}
6666
onMouseOver={that.triggerOver.bind(this, bar)}
67+
key={i}
6768
/>
6869
)
6970
})

0 commit comments

Comments
 (0)