LP
LP
TTCTheo's Typesafe Cult
Created by Nikita Shtimenko on 12/29/2023 in #questions
Vite, React, useQuery, API, Streaming
Are you planning to add the different hook calls (useNews, useUsers) into useHomepage? If so, I don't see the benefit of a "page hook". I would move each call to the specific component. I.e. PostList will call usePosts and deal with the loading state. You can also write a skeleton wrapper for the components that need a loading state. I never tried React Query but I used SWR and it does not play well with Suspense.
5 replies