upgrade yoga-layout

Summary:
- upgraded to yoga-layout@1.9.3
- set default values correctly
- catch errors

Reviewed By: emilsjolander

Differential Revision: D7001154

fbshipit-source-id: 49527576c61ce109ba0af0f50c981cf5c2c7d41a
This commit is contained in:
Daniel Büchele
2018-02-15 16:42:43 -08:00
committed by Facebook Github Bot
parent ae9703712a
commit b318c4c5c9
8 changed files with 70 additions and 65 deletions

View File

@@ -56,7 +56,11 @@ export default class Playground extends Component<Props, State> {
layoutDefinition: {
width: 500,
height: 500,
children: [{}, {}, []],
children: [
{width: 100, height: 100},
{width: 100, height: 100},
{width: 100, height: 100},
],
},
direction: yoga.DIRECTION_LTR,
maxDepth: 3,
@@ -142,7 +146,9 @@ export default class Playground extends Component<Props, State> {
const {selectedNodePath, layoutDefinition} = this.state;
if (selectedNodePath) {
const path = getPath(selectedNodePath).concat('children');
const updatedChildren = layoutDefinition.getIn(path).push(LayoutRecord());
const updatedChildren = layoutDefinition
.getIn(path)
.push(LayoutRecord({width: 100, height: 100}));
this.modifyAtPath(
path,
updatedChildren,