From d6ee448e15a25a7485482a4702aadb2e396445c7 Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Sat, 16 Mar 2019 07:30:04 -0700 Subject: [PATCH] fix switch trackColor on Android. fixes #23962 (#23977) Summary: fixes #23962, where trackColor is reset when value changed. This PR will set trackColor corresponding trackColor every-time value changes. [Android] [Changed] - Fix Switch trackColor Pull Request resolved: https://github.com/facebook/react-native/pull/23977 Differential Revision: D14495206 Pulled By: hramos fbshipit-source-id: d712f540cd3f8359d6e85f79c12732689870a112 --- RNTester/js/SwitchExample.js | 4 ++++ .../react/views/switchview/ReactSwitch.java | 17 +++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/RNTester/js/SwitchExample.js b/RNTester/js/SwitchExample.js index ca36372e378..d1d81811b2b 100644 --- a/RNTester/js/SwitchExample.js +++ b/RNTester/js/SwitchExample.js @@ -54,6 +54,10 @@ class BasicSwitchExample extends React.Component< this.setState({falseSwitchIsOn: value})} + trackColor={{ + true: 'yellow', + false: 'purple', + }} value={this.state.falseSwitchIsOn} />