feat(react-native): Add trackColor to SwitchProps (#29477)

Closes #29466
This commit is contained in:
Kyle Roach
2018-10-05 11:26:49 -07:00
committed by Wesley Wigham
parent d5f7360491
commit d1d7068302
2 changed files with 15 additions and 0 deletions
+9
View File
@@ -8080,6 +8080,8 @@ export interface UIManagerStatic {
export interface SwitchPropsIOS extends ViewProps {
/**
* Background color when the switch is turned on.
*
* @deprecated
*/
onTintColor?: string;
@@ -8095,6 +8097,13 @@ export interface SwitchPropsIOS extends ViewProps {
}
export interface SwitchProps extends SwitchPropsIOS {
/**
* Custom colors for the switch track
*
* Color when false and color when true
*/
trackColor?: { false: string, true: string };
/**
* If true the user won't be able to toggle the switch.
* Default value is false.
+6
View File
@@ -53,6 +53,7 @@ import {
ScrollView,
ScrollViewProps,
SectionListRenderItemInfo,
Switch,
RefreshControl,
TabBarIOS,
NativeModules,
@@ -807,3 +808,8 @@ const NativeBridgedComponent = requireNativeComponent("NativeBridgedComponent",
nativeProp: true,
}
});
const SwitchColorTest = () => (
<Switch trackColor={{ true: 'pink', false: 'red'}} />
)