Update c# docs to use object initializer
Summary: Updates the C# docs to use the object initializer instead of `Create` which doesn't exist anymore. Fixes facebook/yoga#550. Closes https://github.com/facebook/yoga/pull/601 Reviewed By: emilsjolander Differential Revision: D5427217 Pulled By: splhack fbshipit-source-id: 9a2f036335e5ab475d5c1ee8308701ccb5a3b4e4
This commit is contained in:
committed by
Facebook Github Bot
parent
79e294c927
commit
570a193b7e
@@ -124,18 +124,20 @@ root.addChildAt(image, 1);
|
||||
<div class="blockContent">
|
||||
<div markdown="1" style="width: 700px; max-width: 100%;">
|
||||
```csharp
|
||||
YogaNode root = YogaNode.Create(
|
||||
width: 500,
|
||||
height: 300,
|
||||
);
|
||||
YogaNode root = new YogaNode {
|
||||
Width = 500,
|
||||
Height = 300
|
||||
};
|
||||
|
||||
YogaNode image = YogaNode.Create(flexGrow: 1);
|
||||
YogaNode image = new YogaNode {
|
||||
FlexGrow = 1
|
||||
};
|
||||
|
||||
YogaNode text = YogaNode.Create(
|
||||
width: 300,
|
||||
height: 25,
|
||||
margin: new Spacing(left: 20, top: 20, right: 20, bottom: 20),
|
||||
);
|
||||
YogaNode text = new YogaNode {
|
||||
Width = 300,
|
||||
Height = 25,
|
||||
Margin = 20
|
||||
};
|
||||
|
||||
root.Insert(image, 0);
|
||||
root.Insert(text, 1);
|
||||
|
Reference in New Issue
Block a user