Shadcn Hooks

useQuery

useQuery is a hook that allows you to fetch data from an API and cache the results.

useQuery

npx shadcn@latest add "https://shadcn-hooks.vercel.app/r/use-query.json"
pnpm dlx shadcn@latest add "https://shadcn-hooks.vercel.app/r/use-query.json"
yarn dlx shadcn@latest add "https://shadcn-hooks.vercel.app/r/use-query.json"
bun x shadcn@latest add "https://shadcn-hooks.vercel.app/r/use-query.json"

Copy and paste the following code into your project.

npm install @tanstack/react-query
pnpm add @tanstack/react-query
yarn add @tanstack/react-query
bun add @tanstack/react-query

Last updated on

On this page