TanStack Query repository packages folder and terminal commands for cloning and installing

React Query GitHub searches usually come from developers who want the source code, release notes or a direct download. The library lives in the TanStack Query repository, a monorepo that also contains adapters for other frameworks. Knowing how it is organized helps you find the right files quickly.

This article explains the repository layout, the difference between cloning the source and installing from npm, and exactly what the download button on this website provides. For production apps, the npm package remains the recommended installation method.

Where the Source Code Lives

TanStack maintains React Query inside the TanStack/query repository on GitHub. Earlier versions were published from a repository named after React Query, but development now happens in the shared monorepo. The project is released under the MIT license.

The Monorepo Layout

Packages sit in a packages folder, each published separately to npm. The React adapter builds on a framework-agnostic core that also powers the Vue, Solid, Svelte and Angular versions.

Foldernpm packagePurpose
packages/query-core@tanstack/query-coreFramework-agnostic cache engine
packages/react-query@tanstack/react-queryReact hooks and provider
packages/react-query-devtools@tanstack/react-query-devtoolsDeveloper tools panel
packages/vue-query@tanstack/vue-queryVue adapter
packages/solid-query@tanstack/solid-querySolid adapter

Installing Versus Downloading

Applications should install the published package rather than copy source files. npm releases are compiled, versioned and tested, and your package manager handles updates and security advisories. Cloning the repository makes sense when you want to read code, debug internals or contribute.

Terminal
# Recommended for applications
npm install @tanstack/react-query

# For reading or contributing to the source
git clone https://github.com/TanStack/query.git

Building From Source

The monorepo uses pnpm workspaces. After cloning, install dependencies with pnpm and run the build or test scripts defined in the root package file. Contributor instructions in the repository describe the current workflow and required tool versions.

What the Download on This Website Provides

The main download button on our homepage links to a ZIP archive of react-query-kit, an open-source project by HuolalaTech hosted on GitHub. It is a helper toolkit built on top of TanStack Query, not the core React Query library itself.

The kit offers helper functions such as createQuery and createMutation that bundle keys, fetchers and types into reusable definitions. It depends on @tanstack/react-query, so you still install the core package from npm when you use it.

  • Use npm to install React Query itself.
  • Use the ZIP if you want to explore the react-query-kit source.
  • Read each project's license and documentation before production use.

Finding Release Notes

Every published version has release notes on the repository's releases page, listing features, fixes and breaking changes. Reading them before an upgrade prevents surprises, especially across major versions. The v5 changes article summarizes the biggest recent shift.

Checking the Latest Version

The npm registry is the quickest source for the current version number. Running the view command prints the latest tag without installing anything.

Terminal
npm view @tanstack/react-query version
npm view @tanstack/react-query versions --json

Reporting Issues and Contributing

GitHub issues track confirmed bugs, while discussions host questions and ideas. Before opening an issue, search existing ones and prepare a minimal reproduction. Pull requests follow the contribution guidelines in the repository, including tests for behavior changes.

Using the Docs Alongside the Code

Documentation for every adapter is written in the same monorepo and published to the TanStack website. Reading a docs page next to the matching source file is a strong way to understand options such as staleTime or structural sharing in depth.

Reading the Source Effectively

The core package holds the QueryClient, QueryCache and QueryObserver classes that implement caching and refetch rules. The React package is comparatively thin, connecting those classes to components through hooks and context. Starting with the core makes the overall design easier to follow.

Tests next to each source file show the intended behavior in small, readable scenarios. Searching the test files for an option name, such as staleTime or placeholderData, often explains edge cases faster than reading implementation code line by line.

Versions, Branches and Tags

The default branch contains ongoing development, which may include unreleased changes. Tags mark each published version, so checking out a tag gives you exactly the code that npm distributed. Use tags when comparing behavior between versions or investigating a regression.

Older major versions are kept on separate branches for reference. If you maintain a legacy v3 or v4 application, those branches show the code and documentation that match your installed version.

Security and Trust

Install packages only from the npm registry or a trusted mirror, and keep lockfiles committed so dependency versions cannot change unexpectedly. Running your package manager's audit command highlights known vulnerabilities in the dependency tree.

Other TanStack Projects

The same organization maintains TanStack Router, Table, Form and Virtual. They follow similar design principles and often appear together in React projects, especially Router, which integrates with query prefetching for route loaders.

Choosing the Right Option for Your Goal

Different goals call for different sources, and picking correctly saves time.

  • Building an application: install @tanstack/react-query from npm.
  • Learning internals: clone TanStack/query and read the core package.
  • Checking changes: read the release notes for each version.
  • Exploring helper abstractions: review the react-query-kit source ZIP.

Whichever route you take, note the version you are reading or installing. Matching documentation, source code and package versions avoids most confusion when examples online target a different major release than your project.

React Query GitHub FAQ

Is React Query open source?

Yes. TanStack Query is open source under the MIT license, so you can use, modify and distribute it in personal and commercial projects.

Can I download React Query as a ZIP?

GitHub can produce a source ZIP of any branch, but applications should install the compiled package from npm instead of using raw source.

Why does the package name start with @tanstack?

Since v4 the library is published under the TanStack organization scope. Version 3 used the older react-query name.

Conclusion

React Query GitHub resources are centered on the TanStack/query monorepo, where the React adapter sits beside the shared core and other framework packages. Clone it to learn or contribute, and install from npm to build.

Follow the installation article for package manager commands, then start coding with the React Query tutorial.