mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
bf89d1d536
Summary: Some props must have their default values set by native. To be able to support this, we have to introduce a `null` as a supported default value for some types. In this diff I'm adding support for `null` default values for boolean props. Check D17260168 for the example of the usage of the nullable boolean values. Reviewed By: rickhanlonii, TheSavior Differential Revision: D17258234 fbshipit-source-id: 63b7864be97856704d5964230526f23c0e395a67
29 lines
874 B
JavaScript
29 lines
874 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its 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
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {WithDefault} from '../../../../../Libraries/Types/CodegenTypes';
|
|
import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes';
|
|
import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent';
|
|
import {type NativeComponentType} from '../../../../../Libraries/Utilities/codegenNativeComponent';
|
|
|
|
type NativeProps = $ReadOnly<{|
|
|
...ViewProps,
|
|
|
|
// Props
|
|
disabled?: WithDefault<boolean, false>,
|
|
disabledNullable?: WithDefault<boolean, null>,
|
|
|}>;
|
|
|
|
export default (codegenNativeComponent<NativeProps>(
|
|
'BooleanPropNativeComponentView',
|
|
): NativeComponentType<NativeProps>);
|