Created
March 16, 2023 11:20
-
-
Save sibelius/04e8079cdf3f403f1be46826570eaa83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const useLoaderPreloadedQuery<Query> = () => { | |
const preloadedQueryRef = useLoaderData() as PreloadedQuery<Query>; | |
// clean up is important as we are using loadQuery directly without useQueryLoader | |
/ which will handle to dispose auto. | |
useEffect(() => () => preloadedQueryRef.dispose(), [preloadedQueryRef]); | |
return preloadedQueryRef | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment