You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The properties in the react-native section seem no longer compatible with the SWRConfiguration type.
In the docs you have the example of
<SWRConfigvalue={{provider: ()=>newMap(),isOnline(){/* Customize the network state detector */returntrue},isVisible(){/* Customize the visibility state detector */returntrue},initFocus(callback){/* Register the listener with your state provider */},initReconnect(callback){/* Register the listener with your state provider */}}}>
This however misaligns with the exported type of SWRConfiguration as the following properties are missing
provider
initFocus
initReconnect
Upon further inspection of the exported index.d.ts, the missing properties come from type Config which is however not exported.
Unless there's an internal reason for not exposing these methods (which seems contradictory with the react-native documentation) the exported type for SWRConfig should be Config instead
Furthermore when importing the component SWRConfig it just defaults to :any, seems a resolution issue with directly importing react over just importing it's types in the SWRConfig definition. import ReactExports from 'react'
The text was updated successfully, but these errors were encountered:
The properties in the
react-native
section seem no longer compatible with theSWRConfiguration
type.In the docs you have the example of
This however misaligns with the exported type of
SWRConfiguration
as the following properties are missingprovider
initFocus
initReconnect
Upon further inspection of the exported
index.d.ts
, the missing properties come from typeConfig
which is however not exported.where
ProviderConfiguration
is defined asUnless there's an internal reason for not exposing these methods (which seems contradictory with the
react-native
documentation) the exported type forSWRConfig
should beConfig
insteadFurthermore when importing the component
SWRConfig
it just defaults to:any
, seems a resolution issue with directly importing react over just importing it's types in the SWRConfig definition.import ReactExports from 'react'
The text was updated successfully, but these errors were encountered: