Shadcn Hooks

useQuery

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

Installation

npx shadcn@latest add @hooks/use-query
pnpm dlx shadcn@latest add @hooks/use-query
yarn dlx shadcn@latest add @hooks/use-query
bun x shadcn@latest add @hooks/use-query

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