Calling layout on children before laying out node

This commit is contained in:
Jeff Avallone 2019-01-27 08:42:09 -05:00
parent e70705be5f
commit 1ee3055f37
2 changed files with 5 additions and 3 deletions

View File

@ -16,6 +16,10 @@ const layout = data => {
const { type } = data;
if (data.children) {
data.children = data.children.map(layout);
}
return nodeTypes[type]({
props: {},
...data

View File

@ -1,7 +1,5 @@
import layout from 'layout';
const layoutSVG = data => {
const child = layout(data.children[0]);
const child = data.children[0];
data.props.innerWidth = child.box.width;
data.props.innerHeight = child.box.height;