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
While trying to enforce types of the arguments of our fetcher the type override for SWRHooks fell through to BareFetcher which allowed any arguments even if they did not match the key.
Expected Behavior
Should throw a typescript error because the types don't match.
Should throw a typescript error because { path: string } does not match { url: string }.
Additional Context
SWR version 2.2.1
Attempted to remove arguments from BaseFetcher which seemed reasonable that you shouldn't allow the BaseFetcher to contain arguments otherwise it's not a BaseFetcher, this caused tons of cascading issues.
I believe I have a solution replacing the BaseFetcher override with a more basic type. It currently doesn't seem to cause cascading type issues and provides the expected behavior.
This occurred while using the Fetcher type.
The text was updated successfully, but these errors were encountered:
Bug report
Description / Observed Behavior
While trying to enforce types of the arguments of our fetcher the type override for
SWRHooks
fell through toBareFetcher
which allowed any arguments even if they did not match the key.Expected Behavior
Should throw a typescript error because the types don't match.
Repro Steps / Code Example
Should throw a typescript error because
{ path: string }
does not match{ url: string }
.Additional Context
BaseFetcher
which seemed reasonable that you shouldn't allow the BaseFetcher to contain arguments otherwise it's not a BaseFetcher, this caused tons of cascading issues.The text was updated successfully, but these errors were encountered: