mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
5b7be95a1d
Summary: Adds a generated view config for iOS Switch Note: this required some refactoring because the SwitchNativeComponent file included both iOS and android componets, so I broke them out into: - AndroidSwitchNativeComponent (not generated) - SwitchNativeComponent (generated) The schema that we're using is for the iOS version so that's the config that's generated here Reviewed By: cpojer Differential Revision: D15495402 fbshipit-source-id: 07b3bc9c780cbf8f6cbf66e976e15981cefcadfa
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,
|
|
|}>;
|
|
|
|
module.exports = codegenNativeComponent<NativeProps>('Switch', {
|
|
isDeprecatedPaperComponentNameRCT: true,
|
|
});
|