Skip to main content

Command Palette

Search for a command to run...

useFetch, useLazyfetch with Nuxt 3

Published
1 min read
useFetch, useLazyfetch with Nuxt 3
G

CTO of Allocations.com, a finance SaaS Miami-based, I am running a YouTube channel: @codewithguillaume. With 15 years of exp. as a freelancer, consultant, and Lead Developer, I have led dozens of engineering teams across Paris, London, and Berlin. I am father of 2 and I live in Dubai.

useFetch and useLazyFetch are custom hooks that can be used in Nuxt.js version 3 to make API calls.

useFetch can be used to fetch data during the server-side rendering (SSR) process. It will return the data immediately if it is already available, otherwise it will wait for the data to be fetched before rendering the page.

useLazyFetch is similar to useFetch, but it is used to fetch data during the client-side rendering (CSR) process. It will only fetch the data when the component is mounted and will not block the rendering of the page.

Guillaume Duhan