@@ -3,12 +3,17 @@ import { get, map } from 'lodash';
4const ReactSVGComponents = {
4const ReactSVGComponents = {
5 svg: (p, key) => {
5 svg: (p, key) => {
6+ const { width, height, ...attrs } = p.attr;
8− {...p.attr}
9+ {...attrs}
9 version={'1.1'}
12 version={'1.1'}
10 xmlns={'http://www.w3.org/2000/svg'}
13 xmlns={'http://www.w3.org/2000/svg'}
11− key={key}>
14+ key={key}
15+ viewBox={`0 0 ${width} ${height}`}
16+ preserveAspectRatio="xMidYMid meet">
12 {map(get(p, 'children', []), (child, idx) =>
17 {map(get(p, 'children', []), (child, idx) =>
13 ReactSVGComponents[child.tag](child, idx)
18 ReactSVGComponents[child.tag](child, idx)