Skip to content

Commit

Permalink
type: fix type error on SWRConfig (#1913)
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 committed Apr 8, 2022
1 parent 5501fed commit 8d2bbd5
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions 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'
Expand All @@ -13,12 +20,14 @@ import {

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

const SWRConfig: FC<{
value?: SWRConfiguration &
Partial<ProviderConfiguration> & {
provider?: (cache: Readonly<Cache>) => Cache
}
}> = props => {
const SWRConfig: FC<
PropsWithChildren<{
value?: SWRConfiguration &
Partial<ProviderConfiguration> & {
provider?: (cache: Readonly<Cache>) => Cache
}
}>
> = props => {
const { value } = props

// Extend parent context values and middleware.
Expand Down

0 comments on commit 8d2bbd5

Please sign in to comment.