Files
react-native/packages/react-native-codegen/buck_tests/java/DimensionPropNativeComponentViewManager.java
T
Genki Kondo d3cc48d9a6 Add codegen support for DimensionValue for components (#35953)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35953

DimensionValue is a reserved prop type that can be a number or string (such as '50%'). On Java, it will get converted to a YogaValue (converter added to this diff); on C++ it will get converted to a YGValue (converter already exists as it's used in Fabric).

Changelog:
[Internal][Added] - Add codegen support for DimensionValue for components

Reviewed By: cipolleschi

Differential Revision: D42650799

fbshipit-source-id: 1d2bc30bbd93837dedbbb4c74f814963c8140957
2023-01-26 18:52:10 -08:00

39 lines
1.2 KiB
Java

/*
* 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.
*/
package com.facebook.react.uimanager;
import android.view.ViewGroup;
import com.facebook.react.viewmanagers.DimensionPropNativeComponentViewManagerDelegate;
import com.facebook.react.viewmanagers.DimensionPropNativeComponentViewManagerInterface;
import com.facebook.yoga.YogaValue;
public class DimensionPropNativeComponentViewManager extends SimpleViewManager<ViewGroup>
implements DimensionPropNativeComponentViewManagerInterface<ViewGroup> {
public static final String REACT_CLASS = "DimensionPropNativeComponentView";
@Override
public String getName() {
return REACT_CLASS;
}
private void test() {
DimensionPropNativeComponentViewManagerDelegate<
ViewGroup, DimensionPropNativeComponentViewManager>
delegate = new DimensionPropNativeComponentViewManagerDelegate<>(this);
}
@Override
public ViewGroup createViewInstance(ThemedReactContext context) {
throw new IllegalStateException();
}
@Override
public void setMarginBack(ViewGroup view, YogaValue value) {}
}