title: How can i get the previous data using react query
body: <p>I am trying to get the previous data using react query, is there any way to get it?</p>
  <p>I have a custom hook, it updates every time with new data when I scroll down, But when I get the new data I lost the previous data, so I want to get the previous data</p>
  <pre><code>const useActivityFeedData = (
    activityFeedPageIndex: number,
    pageSize = Config.defaultPageSize,
  ) =&gt;
    useQuery(
      [ACTIVITY_FEED, activityFeedPageIndex],
      () =&gt; Api.user.getActivityFeedData(activityFeedPageIndex, pageSize),
      {
        initialData: {
          activityList: [],
        },
        keepPreviousData: true,
        select: (res: any) =&gt; ({
          activityList: res.activityList,
        }),
      },
    );
  </code></pre>