Please sign in to comment.
fix: Preserve state if updateData is passed to useClientRequest. (#76)
### 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
- Loading branch information...
Showing with 73 additions and 1 deletion.