Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On RefreshControl, tintColor sometimes doesn't work #48502

Closed
1280103995 opened this issue Jan 6, 2025 · 17 comments
Closed

On RefreshControl, tintColor sometimes doesn't work #48502

1280103995 opened this issue Jan 6, 2025 · 17 comments
Assignees
Labels
Component: RefreshControl Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available

Comments

@1280103995
Copy link

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

ScreenRecording_01-06-2025.15-56-20_1.MP4

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>
  );
}

@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.76.5. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot react-native-bot added Component: RefreshControl Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Jan 6, 2025
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@princektripathi
Copy link
Collaborator

@1280103995, I couldn't reproduce this issue as per the sample provided by you.

Here is my configuration

System:
  OS: macOS 14.6
  CPU: (14) arm64 Apple M3 Max
  Memory: 264.52 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.18.0
    path: ~/.nvm/versions/node/v20.18.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v20.18.0/bin/yarn
  npm:
    version: 10.8.2
    path: ~/.nvm/versions/node/v20.18.0/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/princetripathi/.rvm/gems/ruby-3.2.2/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12483815
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/princetripathi/.rvm/rubies/ruby-3.2.2/bin/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.5
    wanted: 0.76.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

@krishpranav
Copy link

Hi, any maintainers looking on this issue, can you assign it to me so that I can work on this issue.

@1280103995
Copy link
Author

,我无法根据您提供的示例重现此问题。

这是我的配置

System:
  OS: macOS 14.6
  CPU: (14) arm64 Apple M3 Max
  Memory: 264.52 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.18.0
    path: ~/.nvm/versions/node/v20.18.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v20.18.0/bin/yarn
  npm:
    version: 10.8.2
    path: ~/.nvm/versions/node/v20.18.0/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/princetripathi/.rvm/gems/ruby-3.2.2/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12483815
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/princetripathi/.rvm/rubies/ruby-3.2.2/bin/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.5
    wanted: 0.76.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

I just created a new project (v0.76.5), and the problem still occurred on iPhone XR (iOS 18.2) and iPhone simulator (iOS 18.1).

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jan 8, 2025
@krishpranav
Copy link

@ maintainers kindly assign me this task.

@cortinico
Copy link
Contributor

@krishpranav feel free to work on this one, but we can't assure we'll be able to merge the solution at this stage.

@krishpranav
Copy link

Thanks, will work on this.

@krishpranav
Copy link

@cortinico, currently working for the fix. will update you shortly.

@krishpranav
Copy link

@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.

@krishpranav
Copy link

Screenshot 2025-01-08 at 8 59 04 PM

this is my react-native version.

@1280103995
Copy link
Author

That's very strange, maybe there's something wrong with my development environment.

I'll try it with an Intel Mac later

@krishpranav
Copy link

sure, I've tried it on my silicon machine and the output was same. can you check with it and let me know?

@1280103995
Copy link
Author

My network has a problem and cannot be verified until it is fixed

@1280103995
Copy link
Author

When I run it in release mode, everything works fine.

@krishpranav
Copy link

cool, even though i've patched a minor issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: RefreshControl Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available
Projects
None yet
Development

No branches or pull requests

5 participants