diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index b738bd923d..9642fa3a23 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -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. diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index c01a709351..a040404bed 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -53,6 +53,7 @@ import { ScrollView, ScrollViewProps, SectionListRenderItemInfo, + Switch, RefreshControl, TabBarIOS, NativeModules, @@ -807,3 +808,8 @@ const NativeBridgedComponent = requireNativeComponent("NativeBridgedComponent", nativeProp: true, } }); + + +const SwitchColorTest = () => ( + +)