Replies: 1 comment
-
Try adding return {
[collectionName]: data[collectionName],
isLoading: !error && !data,
isError: error,
empty: data[collectionName] && !data[collectionName].length,
mutate
} as const |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! So I have this SWR useRequest function that is supposed to do some internal remapping of the values I get from useSWR.
I plan to use it like
const useProjects = useRequest<ProjectsResult>('/projects', 'projects')
and have it return type
Unfortunately, the best I can get from it is
Any ideas on how to solve this? It would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions