react-native: On RefreshControl, tintColor sometimes doesn't work
Description
The tintColor property occasionally has no effect on the first render.
Steps to reproduce
Create a new project (npx react-native init XXX)
React Native Version
0.76.3
Affected Platforms
Runtime - iOS
Output of npx react-native info
System:
OS: macOS 14.7.1
CPU: (8) arm64 Apple M1 Pro
Memory: 413.47 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 23.3.0
path: /opt/homebrew/bin/node
Yarn:
version: 1.22.21
path: /opt/homebrew/bin/yarn
npm:
version: 10.9.0
path: /opt/homebrew/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.16.2
path: /Users/fjliang/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.1
- iOS 18.1
- macOS 15.1
- tvOS 18.1
- visionOS 2.1
- watchOS 11.1
Android SDK: Not Found
IDEs:
Android Studio: 2024.2 AI-242.23339.11.2421.12550806
Xcode:
version: 16.1/16B40
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.9
path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/javac
Ruby:
version: 2.7.6
path: /Users/fjliang/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli":
installed: 15.0.1
wanted: 15.0.1
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.76.3
wanted: 0.76.3
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
### Stacktrace or Logs
```text
NO
Reproducer
No. I just created a new app normally.
Screenshots and Videos
https://github.com/user-attachments/assets/60942c07-2b78-4478-8e14-71e118adc68a
App.tsx
import {useRef, useState} from 'react';
import {Button, RefreshControl, ScrollView, View} from 'react-native';
export default function App() {
const scrollviewRef = useRef<ScrollView>(null);
const [isRefreshing, setRefreshing] = useState(false);
const onRefresh = () => {
if (isRefreshing) return;
setRefreshing(true);
setTimeout(() => {
setRefreshing(false);
}, 3000);
};
const scroll = () => {
scrollviewRef.current?.scrollTo({x: 0, y: -200, animated: true});
onRefresh();
};
return (
<View style={{flex: 1, paddingTop: 80}}>
<Button
title={'Test scrollTo'}
onPress={scroll}
/>
<ScrollView
ref={scrollviewRef}
onScroll={(event) => {
console.log('Y --> ', event.nativeEvent.contentOffset.y);
;
}}
style={{marginTop: 30}}
refreshControl={
<RefreshControl
onRefresh={onRefresh}
refreshing={isRefreshing}
colors={['red']}
tintColor={'red'}
progressBackgroundColor={'white'}
/>
}>
<View style={{height: 500, backgroundColor: 'pink'}} />
</ScrollView>
</View>
);
}
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (1 by maintainers)
@1280103995 actually I’ve tried the sample code which you’ve attached and I am not able to reproduce the issue on the latest iPhone 16(iOS 18.2), I will check with older versions of iOS.