Explicitly set default white value on Slider component

Summary:
Changelog: [Internal]

Here is what I believe happens.

We have an instance of `RCTSliderComponentView` which has green thumb tint color.

It gets reused, in prepareForRecycle we call `setThumbTintImage:nil` on its UISlider which internally sets an ivar to `nil`.
Next time `RCTSliderComponentView` gets used without explicit thumb tint color, we assign nil to UISlider's thumb tint color.
Internally this nil gets compared to nil that it saved during `prepareForRecycle` and concludes that the value is already sets and exists early.

Since we don't have access to `UISlider` I can't prove this but here is a short video where I showcase this behavior

{F239923204}

The code in video is here P133083862.

Reviewed By: shergin

Differential Revision: D21997324

fbshipit-source-id: 28a11ed817cc863a313217c475042918ee726011
This commit is contained in:
Samuel Susla
2020-06-11 09:44:20 -07:00
committed by Facebook GitHub Bot
parent 19dcb41a46
commit 2290751ac9
@@ -81,7 +81,10 @@ using namespace facebook::react;
// need to make sure that image properties are reset here
[_sliderView setMinimumTrackImage:nil forState:UIControlStateNormal];
[_sliderView setMaximumTrackImage:nil forState:UIControlStateNormal];
[_sliderView setThumbImage:nil forState:UIControlStateNormal];
if (_thumbImage) {
[_sliderView setThumbImage:nil forState:UIControlStateNormal];
}
_trackImage = nil;
_minimumTrackImage = nil;