diff --git a/Libraries/Components/Switch/Switch.js b/Libraries/Components/Switch/Switch.js index 36fba9446b8d1f..0a9edc8b60c366 100644 --- a/Libraries/Components/Switch/Switch.js +++ b/Libraries/Components/Switch/Switch.js @@ -113,48 +113,18 @@ class Switch extends React.Component { ...props } = this.props; - // Support deprecated color props. - let _thumbColor = thumbColor; - let _trackColorForFalse = trackColor?.false; - let _trackColorForTrue = trackColor?.true; - - // TODO: Remove support for these props after a couple releases. - const {thumbTintColor, tintColor, onTintColor} = (props: $FlowFixMe); - if (thumbTintColor != null) { - _thumbColor = thumbTintColor; - if (__DEV__) { - console.warn( - 'Switch: `thumbTintColor` is deprecated, use `thumbColor` instead.', - ); - } - } - if (tintColor != null) { - _trackColorForFalse = tintColor; - if (__DEV__) { - console.warn( - 'Switch: `tintColor` is deprecated, use `trackColor` instead.', - ); - } - } - if (onTintColor != null) { - _trackColorForTrue = onTintColor; - if (__DEV__) { - console.warn( - 'Switch: `onTintColor` is deprecated, use `trackColor` instead.', - ); - } - } + const trackColorForFalse = trackColor?.false; + const trackColorForTrue = trackColor?.true; if (Platform.OS === 'android') { const platformProps = { enabled: disabled !== true, on: value === true, style, - thumbTintColor: _thumbColor, - trackColorForFalse: _trackColorForFalse, - trackColorForTrue: _trackColorForTrue, - trackTintColor: - value === true ? _trackColorForTrue : _trackColorForFalse, + thumbTintColor: thumbColor, + trackColorForFalse: trackColorForFalse, + trackColorForTrue: trackColorForTrue, + trackTintColor: value === true ? trackColorForTrue : trackColorForFalse, }; return ( @@ -172,7 +142,7 @@ class Switch extends React.Component { const platformProps = { disabled, - onTintColor: _trackColorForTrue, + onTintColor: trackColorForTrue, style: StyleSheet.compose( {height: 31, width: 51}, StyleSheet.compose( @@ -185,8 +155,8 @@ class Switch extends React.Component { }, ), ), - thumbTintColor: _thumbColor, - tintColor: _trackColorForFalse, + thumbTintColor: thumbColor, + tintColor: trackColorForFalse, value: value === true, };