diff --git a/src/utils/config-context.ts b/src/utils/config-context.ts index 2bf2f43..4902535 100644 --- a/src/utils/config-context.ts +++ b/src/utils/config-context.ts @@ -1,4 +1,11 @@ -import { createContext, createElement, useContext, useState, FC } from 'react' +import { + createContext, + createElement, + useContext, + useState, + FC, + PropsWithChildren +} from 'react' import { cache as defaultCache } from './config' import { initCache } from './cache' import { mergeConfigs } from './merge-config' @@ -13,12 +20,14 @@ import { export const SWRConfigContext = createContext>({}) -const SWRConfig: FC<{ - value?: SWRConfiguration & - Partial & { - provider?: (cache: Readonly) => Cache - } -}> = props => { +const SWRConfig: FC< + PropsWithChildren<{ + value?: SWRConfiguration & + Partial & { + provider?: (cache: Readonly) => Cache + } + }> +> = props => { const { value } = props // Extend parent context values and middleware.