Skip to content

Commit

Permalink
Add YogaNode.create()
Browse files Browse the repository at this point in the history
Summary:
Adds a factory method to `YogaNode`.

While this is purely redundant at the moment, it will allow experimentation in follow-up diffs. We will have concrete implementations deriving from `YogaNode` (which will be abstract).

Going through `YogaNode.create()` means that we can maintain ABI compatibility.

Reviewed By: amir-shalem

Differential Revision: D14122974

fbshipit-source-id: 15d92f296d91cc8bbd79a196f370d2dbb69b3f92
  • Loading branch information
davidaurelio authored and ericlewis committed Feb 20, 2019
1 parent 7a9ee87 commit d097951
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -795,4 +795,12 @@ private final long replaceChild(YogaNode newNode, int childIndex) {
newNode.mOwner = this;
return newNode.mNativePointer;
}

public static YogaNode create() {
return new YogaNode();
}

public static YogaNode create(YogaConfig config) {
return new YogaNode(config);
}
}

0 comments on commit d097951

Please sign in to comment.