We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1af69c9 commit 5eceb29Copy full SHA for 5eceb29
test/type/config.tsx
@@ -137,3 +137,15 @@ export function testConfigAsSWRConfiguration() {
137
const { data } = useSWR('/api', fetcher, {} as SWRConfiguration)
138
expectType<Equal<typeof data, { value: string } | undefined>>(true)
139
}
140
+
141
+export function testEmptyConfig() {
142
+ const fetcher = (k: string) => Promise.resolve({ value: k })
143
+ const { data, error, isLoading } = useSWR<{ value: string }, Error>(
144
+ '/api',
145
+ fetcher,
146
+ {}
147
+ )
148
+ expectType<Equal<typeof data, { value: string } | undefined>>(true)
149
+ expectType<Equal<typeof error, Error | undefined>>(true)
150
+ expectType<Equal<typeof isLoading, boolean>>(true)
151
+}
0 commit comments