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
47 lines
1.5 KiB
JavaScript
47 lines
1.5 KiB
JavaScript
/**
|
|
* 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.
|
|
*
|
|
* @format
|
|
* @flow strict-local
|
|
*/
|
|
|
|
import type {
|
|
DimensionValue,
|
|
EdgeInsetsValue,
|
|
PointValue,
|
|
} from '../../../../../Libraries/StyleSheet/StyleSheetTypes';
|
|
import type {ColorValue} from '../../../../../Libraries/StyleSheet/StyleSheet';
|
|
import type {ImageSource} from '../../../../../Libraries/Image/ImageSource';
|
|
import type {
|
|
Int32,
|
|
Float,
|
|
WithDefault,
|
|
} from '../../../../../Libraries/Types/CodegenTypes';
|
|
import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes';
|
|
import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent';
|
|
import type {HostComponent} from '../../../../../Libraries/Renderer/shims/ReactNativeTypes';
|
|
|
|
type NativeProps = $ReadOnly<{|
|
|
...ViewProps,
|
|
|
|
// Props
|
|
names?: $ReadOnlyArray<string>,
|
|
disableds?: $ReadOnlyArray<boolean>,
|
|
progress?: $ReadOnlyArray<Int32>,
|
|
radii?: $ReadOnlyArray<Float>,
|
|
colors?: $ReadOnlyArray<ColorValue>,
|
|
srcs?: $ReadOnlyArray<ImageSource>,
|
|
points?: $ReadOnlyArray<PointValue>,
|
|
edgeInsets?: $ReadOnlyArray<EdgeInsetsValue>,
|
|
dimensions?: $ReadOnlyArray<DimensionValue>,
|
|
sizes?: WithDefault<$ReadOnlyArray<'small' | 'large'>, 'small'>,
|
|
object?: $ReadOnlyArray<$ReadOnly<{|prop: string|}>>,
|
|
|}>;
|
|
|
|
export default (codegenNativeComponent<NativeProps>(
|
|
'ArrayPropsNativeComponentView',
|
|
): HostComponent<NativeProps>);
|