mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 12:45:37 +08:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
508daf2c21
commit
d6ee448e15
@@ -54,6 +54,10 @@ class BasicSwitchExample extends React.Component<
|
||||
<Switch
|
||||
testID="on-off-initial-off"
|
||||
onValueChange={value => this.setState({falseSwitchIsOn: value})}
|
||||
trackColor={{
|
||||
true: 'yellow',
|
||||
false: 'purple',
|
||||
}}
|
||||
value={this.state.falseSwitchIsOn}
|
||||
/>
|
||||
<OnOffIndicator
|
||||
|
||||
Reference in New Issue
Block a user