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
When one go to typescript section of documentation among others can find this lines of code const uid: Key = '<user_id>' and then useSWR(uid,fetcher). It seems to provide no type safety for key, useSWR could be called by useSWR('<user_id>', fetcher) anyways.
But I could like to have type safety for the key argument. Approach to this could be something like this :
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When one go to typescript section of documentation among others can find this lines of code
const uid: Key = '<user_id>'
and thenuseSWR(uid,fetcher)
. It seems to provide no type safety forkey
, useSWR could be called byuseSWR('<user_id>', fetcher)
anyways.But I could like to have type safety for the
key
argument. Approach to this could be something like this :and then use customUseSwr in app.
Beta Was this translation helpful? Give feedback.
All reactions