mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 03:50:11 +08:00
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:
committed by
Facebook Github Bot
parent
00905ab8f7
commit
b5e6ae0fc4
@@ -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<
|
||||
|
||||
Reference in New Issue
Block a user