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 type of response is SWRResponse when it should be SWRResponse<ResponseType | undefined> as when shouldFetch is true the data property in the SWRResponse is undefined.
Additional Context
SWR version.
2.2.5
The text was updated successfully, but these errors were encountered:
Bug report
Description / Observed Behavior
Conditional fetching does not return expected type.
Expected Behavior
The response type should be a union type of the fetcher response type and undefined.
Repro Steps / Code Example
For this example code:
The type of response is SWRResponse when it should be SWRResponse<ResponseType | undefined> as when
shouldFetch
istrue
thedata
property in the SWRResponse is undefined.Additional Context
SWR version.
2.2.5
The text was updated successfully, but these errors were encountered: