Skip to content

Conversation

@bmullan91
Copy link
Contributor

@bmullan91 bmullan91 commented Feb 26, 2019

What does this PR do?

Fixes bugs (listed below) and also introduces integration tests.

Related issues

Checklist

  • I have checked the contributing document
  • I have added or updated any relevant documentation
  • I have added or updated any relevant tests

@bmullan91 bmullan91 marked this pull request as ready for review February 26, 2019 13:29
@bmullan91 bmullan91 force-pushed the useClientRequest_bug_integration_tests branch from 2045254 to be0ddc0 Compare February 26, 2019 15:17
jackdclark
jackdclark previously approved these changes Feb 26, 2019
@bmullan91 bmullan91 merged commit b175db3 into master Feb 27, 2019
@bmullan91 bmullan91 deleted the useClientRequest_bug_integration_tests branch February 27, 2019 10:45
@bmullan91
Copy link
Contributor Author

@all-contributors please add @bmullan91 for test

@allcontributors
Copy link
Contributor

@bmullan91

I've put up a pull request to add @bmullan91! 🎉

Joezo added a commit that referenced this pull request Feb 28, 2019
### What does this PR do?
After updating the next.js example with the latest release we noticed that all our data would disappear when fetching more results. The way we recommend to do that is by updating the variables passed into `useQuery` and supplying an `updateData` method, which is responsible for merging the previous and new results. 

We previously merged a fix (#61) that resets state if variables or query changes in `useClientRequest`. The fix in this is to only reset the state if `updateData` is not set. This means that `state.data` is always populated after the initial request in this scenario.

### Checklist

- [x] I have checked the [contributing document](../blob/master/CONTRIBUTING.md)
- [x] I have added or updated any relevant documentation
- [x] I have added or updated any relevant tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants