mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
d3cc48d9a6
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
39 lines
1.2 KiB
Java
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) {}
|
|
}
|