Unify native props

Summary: Unify native props for Switch

Reviewed By: TheSavior, mdvacca

Differential Revision: D13563403

fbshipit-source-id: d219febf197bd024d1ef2acda9f42e40bdf39532
This commit is contained in:
Luna Wei
2019-01-07 15:36:33 -08:00
committed by Facebook Github Bot
parent 00905ab8f7
commit b5e6ae0fc4
4 changed files with 95 additions and 19 deletions

View File

@@ -18,25 +18,33 @@ const requireNativeComponent = require('requireNativeComponent');
import type {SwitchChangeEvent} from 'CoreEventTypes';
import type {ViewProps} from 'ViewPropTypes';
type SwitchProps = $ReadOnly<{|
...ViewProps,
disabled?: ?boolean,
onChange?: ?(event: SwitchChangeEvent) => mixed,
thumbColor?: ?string,
trackColorForFalse?: ?string,
trackColorForTrue?: ?string,
value?: ?boolean,
|}>;
// @see ReactSwitchManager.java
export type NativeAndroidProps = $ReadOnly<{|
...ViewProps,
...SwitchProps,
enabled?: ?boolean,
on?: ?boolean,
onChange?: ?(event: SwitchChangeEvent) => mixed,
thumbTintColor?: ?string,
trackTintColor?: ?string,
|}>;
// @see RCTSwitchManager.m
export type NativeIOSProps = $ReadOnly<{|
...ViewProps,
disabled?: ?boolean,
onChange?: ?(event: SwitchChangeEvent) => mixed,
...SwitchProps,
onTintColor?: ?string,
thumbTintColor?: ?string,
tintColor?: ?string,
value?: ?boolean,
|}>;
type SwitchNativeComponentType = Class<