usehooks
usehooks copied to clipboard
useAppLoading , usePageLoading hooks for react-query
Hi, made two simple hooks that could be useful that can be used with React Query to handle loading App loading and Page loading useApploading : show loading screen one time only when users enter web app, disappear when react query finish fetching data for the current page (after that it won't show at all )
usePageLoading : show loading every time there are queries fetching with react query, note that when the query is fresh the loading state is false, on the contrary when the query is stale the loading state is true codesandbox example better demo app example