Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Error handling #1874

ryanvazquez started this conversation in General
Discussion options

Feature Request: Error Handling Support in FlashList

Problem

We currently use FlashList to render an infinite social feed. A common error handling pattern is to check for an error and render a fallback component:

function MyComponent() {
 if (error) {
 return <Error />
 }
 return (
 <FlashList ... />
 )
}

Issue: This approach completely unmounts FlashList when an error occurs, requiring a full remount after the error is cleared. This results in:

  • Loss of scroll position
  • Performance overhead from remounting
  • Poor user experience during error recovery

Workaround

Errors could be handled at the call site and ignored to keep FlashList mounted:

function MyComponent() {
 if (error) {
 // logError('error');
 // showToast('error')
 }
 return (
 <FlashList ... />
 )
}

Limitation: While this keeps FlashList mounted, it provides no visual feedback to users about the error state in the list itself.

Proposed Solution

Add built-in error handling support to FlashList, similar to how ListEmptyComponent works:

<FlashList
 data={data}
 renderItem={renderItem}
 ListErrorComponent={ErrorComponent}
 error={error}
 // ... other props
/>

This would allow FlashList to:

  • Stay mounted during error states
  • Gracefully display error fallbacks
  • Maintain scroll position and performance
  • Provide an idiomatic error handling pattern
You must be logged in to vote

Replies: 0 comments

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

AltStyle によって変換されたページ (->オリジナル) /