From 14b0ed4c5d872cd992f6e1ca072a2c44c8ece25f Mon Sep 17 00:00:00 2001 From: Guilherme Iscaro Date: Tue, 30 Jul 2019 04:22:14 -0700 Subject: [PATCH] Do not override ActivityIndicator color when setting its size (#25849) Summary: The activityIndicatorViewStyle property overrides the previous set color if it's changed. Depending on the property set order you may end in a state that the color property will never be respected since it first sets the color and then the activityIndicatorViewStyle property (which overrides the color property). In order to prevent this problem before setting the new activityIndicatorViewStyle save the old color and override it after activityIndicatorViewStyle is set. Thus always respecting the user's color. ## Changelog [iOS] [Fixed] - Do not override ActivityIndicator color when setting its size Pull Request resolved: https://github.com/facebook/react-native/pull/25849 Test Plan: Using the code below on iOS notice that the last ActivityIndicator will always have its color set to white while te testID is provided ### Without the patch Notice the white -> blue transition when disabling the testID ![broken](https://user-images.githubusercontent.com/984610/61999339-16c2ed80-b095-11e9-80f7-81c38eca761a.gif) ### With the patch Color remains unchanged ![working](https://user-images.githubusercontent.com/984610/61999338-1165a300-b095-11e9-9cb6-e45999db1544.gif) ```javascript import React from "react"; import { View, StyleSheet, ActivityIndicator, Button } from "react-native"; const App = () => { const [enableTestID, onSetEnableTestID] = React.useState(true); const onPress = React.useCallback(() => { onSetEnableTestID(!enableTestID); }, [enableTestID]); return (