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 authored and shuding committed Apr 10, 2022
1 parent 04b8302 commit 6bb79f7
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/utils/config-context.ts
Original file line number Diff line number Diff line change
@@ -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 6bb79f7

Please sign in to comment.