Skip to content

Commit ec83f43

Browse files
himself65himanshiLt
authored andcommitted
type: fix type error on SWRConfig (vercel#1913)
Refs: DefinitelyTyped/DefinitelyTyped#56210
1 parent c75d788 commit ec83f43

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/utils/config-context.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { createContext, createElement, useContext, useState, FC } from 'react'
1+
import {
2+
createContext,
3+
createElement,
4+
useContext,
5+
useState,
6+
FC,
7+
PropsWithChildren
8+
} from 'react'
29
import { cache as defaultCache } from './config'
310
import { initCache } from './cache'
411
import { mergeConfigs } from './merge-config'
@@ -13,12 +20,14 @@ import {
1320

1421
export const SWRConfigContext = createContext<Partial<FullConfiguration>>({})
1522

16-
const SWRConfig: FC<{
17-
value?: SWRConfiguration &
18-
Partial<ProviderConfiguration> & {
19-
provider?: (cache: Readonly<Cache>) => Cache
20-
}
21-
}> = props => {
23+
const SWRConfig: FC<
24+
PropsWithChildren<{
25+
value?: SWRConfiguration &
26+
Partial<ProviderConfiguration> & {
27+
provider?: (cache: Readonly<Cache>) => Cache
28+
}
29+
}>
30+
> = props => {
2231
const { value } = props
2332

2433
// Extend parent context values and middleware.

0 commit comments

Comments
 (0)