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

RefreshControl refresh indicator is not shown on iOS #35779

Open
danielmorlock opened this issue Jan 5, 2023 · 8 comments
Open

RefreshControl refresh indicator is not shown on iOS #35779

danielmorlock opened this issue Jan 5, 2023 · 8 comments

Comments

@danielmorlock
Copy link

danielmorlock commented Jan 5, 2023

Description

The refresh indicator for <RefreshControl /> is not shown in<ScrollView> and related components like <VirtualizedList /> and <FlatList /> etc.. when refreshing is initially set as true (i.e. refreshing={true}).

This happens in both, when using Expo Go and when using the build iOS app.

Version

0.69.7, 0.70.6

Output of npx react-native info

System:
OS: Linux 5.15 Gentoo Linux
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Memory: 16.15 GB / 62.44 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.17.0 - ~/.config/nvm/versions/node/v16.17.0/bin/node
Yarn: 1.22.19 - ~/workspace/fgs/mobile/node_modules/.bin/yarn
npm: 2.15.12 - ~/workspace/fgs/mobile/node_modules/.bin/npm
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.6 => 0.69.6
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

<ScrollView
        contentContainerStyle={styles.scrollView}
        refreshControl={
          <RefreshControl
            refreshing={true}
            onRefresh={onRefresh}
          />
        }
      >
        <Text>
        This refresh indicator is not shown on iOS
        </Text>
      </ScrollView>

Snack, code example, screenshot, or link to a repository

https://snack.expo.dev/@danielmorlock/refresh-indicator-bug

@ngima
Copy link

ngima commented Jan 23, 2023

I'm also having this issue. To resolve I'm setting refreshing boolean after 10 mills

const fetchData = ()=>{
    this.setRefreshing(true)
    //... data fetching logic
}


React.useEffect(() => {
    setTimeout(() => {
        state.fetchData()
    }, 10)
}, [])

@built-by-as
Copy link

I am also having this issue, the RefreshControl will not show when initially set to true. It will only show on pull to refresh

@Alecattie
Copy link

I am also having this issue, any update?

@madox2
Copy link

madox2 commented Aug 17, 2023

I was able to work around with setTimeout as @ngima mentioned above:

import { useEffect, useState } from 'react';
import {
  RefreshControlProps,
  RefreshControl as RefreshControlRN,
} from 'react-native';

export function RefreshControl({ refreshing, ...other }: RefreshControlProps) {
  const [isRefreshing, setRefreshing] = useState(false);
  useEffect(() => {
    setTimeout(() => {
      setRefreshing(refreshing);
    }, 10);
  }, [refreshing]);
  return <RefreshControlRN refreshing={isRefreshing} {...other} />;
}

Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 14, 2024
@zackify
Copy link

zackify commented Feb 14, 2024

It’s still a problem…

@github-actions github-actions bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 15, 2024
@saurori
Copy link

saurori commented Feb 21, 2024

I am experiencing this exact problem. In the code example (or in your app), if you pull the screen down a bit you can see the loading icon so it's there, just not visible.

@w3company-leo
Copy link

same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants