@@ -2,59 +2,59 @@ import React from 'react'
2import { get, map } from 'lodash'
2import { get, map } from 'lodash'
4const ReactSVGComponents = {
4const ReactSVGComponents = {
5− svg: p => {
5+ svg: (p, key) => {
7− <svg {...p.attr} version={'1.1'} xmlns={'http://www.w3.org/2000/svg'}>
7+ <svg {...p.attr} version={'1.1'} xmlns={'http://www.w3.org/2000/svg'} key={key}>
8− { map(get(p, 'children', []), child => ReactSVGComponents[child.tag](child)) }
8+ { map(get(p, 'children', []), (child, idx) => ReactSVGComponents[child.tag](child, idx)) }
12− circle: p => {
12+ circle: (p, key) => {
14− <circle {...p.attr}>
14+ <circle {...p.attr} key={key}>
15− { map(get(p, 'children', []), child => ReactSVGComponents[child.tag](child)) }
15+ { map(get(p, 'children', []), (child, idx) => ReactSVGComponents[child.tag](child, idx)) }
19− rect: p => {
19+ rect: (p, key) => {
21− <rect {...p.attr}>
21+ <rect {...p.attr} key={key}>
22− { map(get(p, 'children', []), child => ReactSVGComponents[child.tag](child)) }
22+ { map(get(p, 'children', []), (child, idx) => ReactSVGComponents[child.tag](child, idx)) }
26− path: p => {
26+ path: (p, key) => {
28− <path {...p.attr}>
28+ <path {...p.attr} key={key}>
29− { map(get(p, 'children', []), child => ReactSVGComponents[child.tag](child)) }
29+ { map(get(p, 'children', []), (child, idx) => ReactSVGComponents[child.tag](child, idx)) }
33− g: p => {
33+ g: (p, key) => {
35− <g {...p.attr}>
35+ <g {...p.attr} key={key}>
36− { map(get(p, 'children', []), child => ReactSVGComponents[child.tag](child)) }
36+ { map(get(p, 'children', []), (child, idx) => ReactSVGComponents[child.tag](child, idx)) }
40− polygon: p => {
40+ polygon: (p, key) => {
42− <polygon {...p.attr}>
42+ <polygon {...p.attr} key={key}>
43− { map(get(p, 'children', []), child => ReactSVGComponents[child.tag](child)) }
43+ { map(get(p, 'children', []), (child, idx) => ReactSVGComponents[child.tag](child, idx)) }
44 </polygon>
44 </polygon>
47− line: p => {
47+ line: (p, key) => {
49− <line {...p.attr}>
49+ <line {...p.attr} key={key}>
50− { map(get(p, 'children', []), child => ReactSVGComponents[child.tag](child)) }
50+ { map(get(p, 'children', []), (child, idx) => ReactSVGComponents[child.tag](child, idx)) }
54− polyline: p => {
54+ polyline: (p, key) => {
56− <polyline {...p.attr}>
56+ <polyline {...p.attr} key={key}>
57− { map(get(p, 'children', []), child => ReactSVGComponents[child.tag](child)) }
57+ { map(get(p, 'children', []), (child, idx) => ReactSVGComponents[child.tag](child, idx)) }
58 </polyline>
58 </polyline>