mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
a3b9840885
Summary: This diff turns on codegen for Slider and Switch Reviewed By: TheSavior Differential Revision: D15738544 fbshipit-source-id: a0dfb5b05fd62f28fc3865855986e49598dd5e19
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
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.
|
|
*
|
|
* @flow
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {BubblingEvent, WithDefault} from '../../Types/CodegenTypes';
|
|
import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
|
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
|
|
import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
|
|
|
|
type SwitchChangeEvent = $ReadOnly<{|
|
|
value: boolean,
|
|
|}>;
|
|
|
|
type NativeProps = $ReadOnly<{|
|
|
...ViewProps,
|
|
|
|
// Props
|
|
disabled?: ?WithDefault<boolean, false>,
|
|
value?: ?WithDefault<boolean, false>,
|
|
tintColor?: ?ColorValue,
|
|
onTintColor?: ?ColorValue,
|
|
thumbTintColor?: ?ColorValue,
|
|
|
|
// Deprecated props
|
|
thumbColor?: ?ColorValue,
|
|
trackColorForFalse?: ?ColorValue,
|
|
trackColorForTrue?: ?ColorValue,
|
|
|
|
// Events
|
|
onChange?: ?(event: BubblingEvent<SwitchChangeEvent>) => mixed,
|
|
|}>;
|
|
|
|
export default codegenNativeComponent<NativeProps>('Switch', {
|
|
isDeprecatedPaperComponentNameRCT: true,
|
|
});
|