TanStack

Just Fucking Use TanStack

Look, I get it. You've built your own state management. You've written custom hooks for data fetching. You've implemented your own table sorting logic for the 47th time. You're a real developer.

Congratulations. You've also wasted hundreds of hours.

The Same Shit, Every Project

Every React project eventually needs:

And every time, developers think: "I'll just build it myself, how hard can it be?"

It's hard. That's why Tanner Linsley already did it for you.

TanStack Query

Still writing useEffect + useState for API calls? Still manually tracking loading states? Still wondering why your data is stale?

// Your code
const [data, setData] = useState(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);

useEffect(() => {
  fetch('/api/users')
    .then(res => res.json())
    .then(setData)
    .catch(setError)
    .finally(() => setLoading(false));
}, []);

// What about refetch? Caching? Race conditions?
// Good luck.

Or just:

const { data, isLoading, error } = useQuery({
  queryKey: ['users'],
  queryFn: () => fetch('/api/users').then(r => r.json())
});

Caching, deduplication, background refetch, retry logic, devtools — all included.

TanStack Router

React Router is fine. But do you want fine, or do you want type-safe routing that catches errors at build time instead of in production at 3am?

No more parseInt(params.id) everywhere. No more runtime crashes from typos in route names.

TanStack Start

Need a full-stack framework? TanStack Start is a full-stack React framework built on TanStack Router and Vite.

No compromises between server-side and client-side. You get both.

TanStack Table

Need a table with sorting, filtering, pagination, column resizing, row selection, and virtualization?

Go ahead. Build it yourself. I'll wait.

...

Still waiting.

Or use TanStack Table and have all of that in an afternoon. It's headless, so style it however you want. Works with React, Vue, Solid, Svelte, or vanilla JS. Handles 10 rows or 10 million rows.

TanStack Virtual

Got a list with 10,000 items? 100,000? A million?

TanStack Virtual renders only what's visible. 60 FPS, always. Vertical, horizontal, or grid layouts. Fixed or dynamic sizing. 10-15kb gzipped.

Your users won't know you're virtualizing. They'll just know your app is fast.

TanStack Form

Forms are hell. You know it. I know it.

Validation on blur? On change? On submit? Field-level errors? Form-level errors? Async validation? Dependent field validation? Array fields?

TanStack Form handles all of it. With types. Without the bloat.

TanStack DB

Need a reactive client-side data store? TanStack DB gives you:

It's like having a real database in your browser. Currently in beta, but already impressive.

"But I Don't Want Another Dependency"

Cool. Enjoy maintaining your 2000 lines of custom data fetching logic. Enjoy debugging race conditions at midnight. Enjoy explaining to your team why the cache isn't invalidating properly.

Dependencies aren't bad. Bad dependencies are bad. TanStack libraries are:

"The Learning Curve Though..."

You know what has a steeper learning curve? Debugging your homegrown solution six months from now when you've forgotten how it works.

TanStack has excellent docs, examples, and a Discord. Your custom hook has a comment that says // TODO: fix this later.

Just Use It

Stop overthinking. Stop reinventing. Stop suffering.

npm install @tanstack/react-query
npm install @tanstack/react-router
npm install @tanstack/react-table
npm install @tanstack/react-form
npm install @tanstack/react-virtual

Your future self will thank you. Your team will thank you. Your users will thank you.

Just fucking use TanStack →