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

Bugfix/keep previous data error #1665

Merged
merged 4 commits into from
Jan 17, 2021
Merged

Bugfix/keep previous data error #1665

merged 4 commits into from
Jan 17, 2021

Conversation

TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Jan 17, 2021

closes #1659

@vercel
Copy link

vercel bot commented Jan 17, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tannerlinsley/react-query/aj37fbalz
✅ Preview: https://react-query-git-fork-tkdodo-bugfix-keeppreviousdata-error.tannerlinsley.vercel.app

Comment on lines +1181 to +1195
expect(states[2]).toMatchObject({
data: 0,
isFetching: true,
status: 'success',
error: null,
isPreviousData: true,
})
// Hook state update
expect(states[3]).toMatchObject({
data: 0,
isFetching: true,
status: 'success',
error: null,
isPreviousData: true,
})
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not really sure why we get two re-renders with the same state, but this is the same for the already existing keepPreviousData tests 🤔

@tannerlinsley tannerlinsley merged commit ead2e5d into TanStack:master Jan 17, 2021
@TkDodo TkDodo deleted the bugfix/keepPreviousData-error branch January 17, 2021 21:20
@tannerlinsley
Copy link
Collaborator

🎉 This PR is included in version 3.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Possible inconsistency with isError and error when using keepPreviousData: true
2 participants