You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey folks, when using the refreshControl as a prop to ScrollView, I'm seeing a slight difference between Android and iOS.
Steps to reproduce
If I directly use the RefreshControl component from React Native as JSX, it works on Android and iOS
If I wrap RefreshControl in a custom component and pass it as JSX, it works on iOS, but Android crashes
If I call my custom component as a function in the prop, it works on both Android and iOS.
import{ScrollView,RefreshControl}from'react-native'constCustomRefreshControl=()=>{const[refreshing,setRefreshing]=useState(false);constonRefresh=()=>{setRefreshing(true);setTimeout(()=>{setRefreshing(false);},2000);};return<RefreshControlrefreshing={refreshing}onRefresh={onRefresh}/>;};// This works on Android and iOSconstSomeScreen=()=>{<ScrollViewrefreshControl={<RefreshControlrefreshing={true}onRefresh={()=>null}/>}// This works on iOS, not on AndroidconstSomeScreen=()=>{<ScrollViewrefreshControl={<CustomRefreshControl/>}// This works on Android and iOSconstSomeScreen=()=>{<ScrollViewrefreshControl={CustomRefreshControl()}
At first I thought maybe RefreshControl was special and didn't want to be wrapped. Or that the refreshControl prop on ScrollView always wanted to call a function. But the difference cross-platform makes me think that it's a bug somewhere.
Very minor pain point, but I thought I'd capture it in case that's helpful, or perhaps I've misunderstood how it ought to work.
Given you tested on 0.78, I assume this is what you observe in the New Architecture, am I right? Have you perhaps checked also the old architecture to see how it behaved?
Yes, so far I've only checked on new arch. I ran into this originally on an Expo SDK 52 app, so it seems to also happen back to v0.76 (also on new arch). For the reproducer I wanted to see if it was an issue on latest.
Description
Hey folks, when using the
refreshControl
as a prop toScrollView
, I'm seeing a slight difference between Android and iOS.Steps to reproduce
RefreshControl
component from React Native as JSX, it works on Android and iOSRefreshControl
in a custom component and pass it as JSX, it works on iOS, but Android crashesAt first I thought maybe
RefreshControl
was special and didn't want to be wrapped. Or that therefreshControl
prop onScrollView
always wanted to call a function. But the difference cross-platform makes me think that it's a bug somewhere.Very minor pain point, but I thought I'd capture it in case that's helpful, or perhaps I've misunderstood how it ought to work.
React Native Version
0.78.0
Affected Platforms
Runtime - Android
Output of
npx @react-native-community/cli info
Stacktrace or Logs
Reproducer
https://github.com/coolsoftwaretyler/RefreshControlReproducer
Screenshots and Videos
Video was too big for GH upload, here's a Dropbox: https://www.dropbox.com/scl/fi/a8106gdwf4st88lsemsuq/2025-03-06-refresher-bug.mov?rlkey=e61k2c5kh3l1ffh8h4k9wes51&st=hdw29mc4&dl=0
The text was updated successfully, but these errors were encountered: