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 9a7c768 commit db93f66
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

3 comments on commit db93f66

@janek26
Copy link

@janek26 janek26 commented on db93f66 Apr 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need this as a patch release please :-)

@shuding
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janek26 Published v1.3.0, give it a try!

@janek26
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shuding thanks a lot sir! Great lib from a great company!

Please sign in to comment.