SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Pass through track color values for true/false to native component

Summary:
There's a bug in the OSS Switch component where the track color value is reset to the default value when the switch is toggled. It looks like the Java class resets the track color value in `setOn` (which fires in a press event): https://fburl.com/vmugfzja but these values aren't actually initialized from JS - in Switch.js we only pass through the current track color: https://fburl.com/vytekd0o.

The React component already has an API for defining both true/false track colors. However, we should also make sure not to reset these values for people using the old API of `tintColor`/`onTintColor`, so I'm changing it to only reset the value when both of those props are null.

Reviewed By: mdvacca

Differential Revision: D14035007

fbshipit-source-id: 12d968076bd47d54deedbfc15b12ff3cd77e2fd0
E
Emily Janzer committed
7652e31d8c233c1c831f6597c8a2f7ce3d9c0b6e
Parent: 2d86d38
Committed by Facebook Github Bot <facebook-github-bot@users.noreply.github.com> on 2/12/2019, 6:47:58 PM