Skip to content

Commit 5f806e3

Browse files
committed
Default data value is now undefined instead of null
1 parent 4d29dfa commit 5f806e3

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.3.26
4+
5+
- By default the initial state for `data` is now `undefined` instead of `null`, allowing for use of default parameters in destructuring. While this may technically be a "breaking" change, it's more of a bug in spirit as it was not intended to be shipped this way. Don't like this? Become a sponsor and demand otherwise ;)
6+
37
## 0.3.25
48

59
- Fixed an issue where `cancelQueries` was called while not being defined

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ const {
13331333
- When `true`, `useQuery` will throw runtime errors when `error` would normally be truthy
13341334
- `initialData: any`
13351335
- Optional
1336-
- If set, this value will be used as the initial data for the query (as long as the query hasn't been created or cached yet)
1336+
- If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet)
13371337
13381338
### Returns
13391339

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function useConfigContext() {
8888
}
8989

9090
function makeQuery(options) {
91-
let initialData = options.config.paginated ? [] : null
91+
let initialData = options.config.paginated ? [] : undefined
9292

9393
if (typeof options.config.initialData !== 'undefined') {
9494
initialData = options.config.initialData

0 commit comments

Comments
 (0)