Skip to content

Commit

Permalink
test: types placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Sep 27, 2024
1 parent 1fae179 commit 2b8b303
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/use-query.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,24 @@ describe('useQuery type inference', () => {
},
})
})

it('allows nullish and void returns in placeholderData', () => {
useQuery({
query: async () => 42,
key: ['foo'],
placeholderData: () => {
return null
},
})

useQuery({
query: async () => 42,
key: ['foo'],
placeholderData: () => {
// no return
},
})
})
})

class MyCustomError extends Error {
Expand Down

0 comments on commit 2b8b303

Please sign in to comment.