Migrate YogaNodeType enum to Kotlin (#56792)

Summary:
X-link: https://github.com/facebook/yoga/pull/1953

Pull Request resolved: https://github.com/facebook/react-native/pull/56792

Migrate YogaNodeType.java to YogaNodeType.kt by adding NodeType to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666338

fbshipit-source-id: aed887c3cd1ca5f86e4ce68c38a4c75b5ab7c594
This commit is contained in:
Nicola Corti authored and meta-codesync[bot] committed 2026-05-12 18:22:02 -07:00
1 parent 1faa66551a
commit bb137aa028
2 files changed
+27 -33

No files matched your search

@@ -1,33 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @generated by enums.py
package com.facebook.yoga;
public enum YogaNodeType {
DEFAULT(0),
TEXT(1);
private final int mIntValue;
YogaNodeType(int intValue) {
mIntValue = intValue;
}
public int intValue() {
return mIntValue;
}
public static YogaNodeType fromInt(int value) {
switch (value) {
case 0: return DEFAULT;
case 1: return TEXT;
default: throw new IllegalArgumentException("Unknown enum value: " + value);
}
}
}
@@ -0,0 +1,27 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @generated by enums.py
package com.facebook.yoga
public enum class YogaNodeType(public val intValue: Int) {
DEFAULT(0),
TEXT(1);
public fun intValue(): Int = intValue
public companion object {
@JvmStatic
public fun fromInt(value: Int): YogaNodeType =
when (value) {
0 -> DEFAULT
1 -> TEXT
else -> throw IllegalArgumentException("Unknown enum value: $value")
}
}
}