Skip to content
This repository was archived by the owner on Jun 4, 2026. It is now read-only.
This repository was archived by the owner on Jun 4, 2026. It is now read-only.

doFeedRequest with offset #240

Description

@voortexx

Setup

  • iOS or Android? Both
  • Expo or regular React Native? Regular
  • React Native Version: 0.64.2
  • react-native-activity-feed: 0.8.22
  • getstream: 4.5.4

Describe the bug
Currently we use the FlatFeed with the ListEmptyComponent props to display a fallback image when we have no messages.

We would like to be able to distinguish the loading state with no data (to display a placeholder) from the state where we have no data (to display another image).

From what I've seen we don't have access to any isLoading props to know if the first get is finished.

So I tried simply like this

  const doFeedRequest = async () => {
    const response = await feed.get({ withReactionCounts: true, offset })
    const newOffset = offset + response.results.length
    setOffset(newOffset)
    return response
  }

This works except that when I scroll down my offset is reset and so the data loaded is always the same.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions