reactjs

Tag: reactjs

50 posts
React/Next : What Runs When, and What Comes OutReact/Next : What Runs When, and What Comes Out
Vishuddha icon
Vishuddha

React/Next : What Runs When, and What Comes Out

Here's a test. Take this component:

·
Sep 5
·
How React Actually Updates the DOM — VDOM, Reconciliation, Fiber, and Why Signals Are a Different Idea EntirelyHow React Actually Updates the DOM — VDOM, Reconciliation, Fiber, and Why Signals Are a Different Idea Entirely
Vishuddha icon
Vishuddha

How React Actually Updates the DOM — VDOM, Reconciliation, Fiber, and Why Signals Are a Different Idea Entirely

Here’s a question I sat with for longer than I should have: if React’s Virtual DOM is supposed to make things faster, why does a complex React app sometimes feel slower than a simple jQuery one?

·
Sep 5
·
Reliable Query Prefetching with TanStack RouterReliable Query Prefetching with TanStack Router
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Reliable Query Prefetching with TanStack Router

Prefetching in route loaders is great, but comes at a cost. We have to keep loaders in-sync with components...

·
Aug 17
·
TanStack Router and QueryTanStack Router and Query
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

TanStack Router and Query

TanStack Router has a built-in cache, so why would we need TanStack Query? There are, of course, reasons ...

·
May 25
·
Test IDs are an a11y smellTest IDs are an a11y smell
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Test IDs are an a11y smell

Users don't use data-testid, so why do your tests?

·
Mar 22
·
Creating Query AbstractionsCreating Query Abstractions
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Creating Query Abstractions

Building reusable abstractions on top of libraries that rely on type inference can be deceptively difficult, which is why we need better ways to build those abstractions ...

·
Feb 22
·
Building Type-Safe Compound ComponentsBuilding Type-Safe Compound Components
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Building Type-Safe Compound Components

Compound Components are great, but should be type-safe. No, this isn't about the children prop ...

·
Jan 1
·
Designing Design SystemsDesigning Design Systems
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Designing Design Systems

I want to write more about what makes a good design system. This is the unstructured list of principles I think matter.

·
Nov 30 '25
·
Omit for Discriminated Unions in TypeScriptOmit for Discriminated Unions in TypeScript
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Omit for Discriminated Unions in TypeScript

Why TypeScript’s built-in Omit breaks discriminated unions, and how a distributive version preserves them.

·
Nov 23 '25
·
Tooltip Components Should Not ExistTooltip Components Should Not Exist
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Tooltip Components Should Not Exist

A look at why tooltip components are often the wrong abstraction in design systems, leading to accessibility issues, misuse, and inconsistent user experiences.

·
Nov 16 '25
·
Context Inheritance in TanStack RouterContext Inheritance in TanStack Router
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Context Inheritance in TanStack Router

An overview of how TanStack Router automatically shares and infers path params, search params, and context between nested routes in a type-safe way.

·
Oct 11 '25
·
Deriving Client State from Server StateDeriving Client State from Server State
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Deriving Client State from Server State

How to use derived state in React to keep client state and server data aligned without manual sync or effects.

·
Aug 31 '25
·
React Query Selectors, SuperchargedReact Query Selectors, Supercharged
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

React Query Selectors, Supercharged

How to get the most out of select, sprinkled with some TypeScript tips.

·
Aug 3 '25
·
The Useless useCallbackThe Useless useCallback
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

The Useless useCallback

Why most memoization is downright useless...

·
Jul 27 '25
·
The Beauty of TanStack RouterThe Beauty of TanStack Router
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

The Beauty of TanStack Router

Yes, it's type-safe, but there's so much more to love about TanStack Router.

·
May 24 '25
·
Concurrent Optimistic Updates in React QueryConcurrent Optimistic Updates in React Query
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Concurrent Optimistic Updates in React Query

How to build optimistic UI that is resilient to race conditions, even when multiple mutations update the same entity concurrently.

·
Apr 27 '25
·
React Query - The Bad PartsReact Query - The Bad Parts
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

React Query - The Bad Parts

In this talk, maintainer Dominik will explore the other side—the less favorable aspects of React Query and situations where it may not be the best fit. No library is perfect; every choice involves trade-offs. By the end of this talk, you'll have a better understanding of React Query's limitations and why it remains a compelling choice despite them.

·
Dec 27 '24
·
Ref Callbacks, React 19 and the CompilerRef Callbacks, React 19 and the Compiler
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Ref Callbacks, React 19 and the Compiler

Reflecting on useCallback, how the Compiler changed my thinking about it, and what React 19 has in store for Ref Callbacks...

·
Dec 7 '24
·
React Query API Design - Lessons LearnedReact Query API Design - Lessons Learned
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

React Query API Design - Lessons Learned

In this talk, React Query maintainer Dominik will walk us through some of the API design choices that were made in React Query to get to that DX. You'll hear stories about things that went well, but also about tradeoffs and mistakes that were made, and what lessons we can all learn from those.

·
Oct 24 '24
·
Component Composition is great btwComponent Composition is great btw
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Component Composition is great btw

Component composition is one of the best parts of React, and I think we should take more time to break our components into manageable parts before littering one component with conditional renderings.

·
Sep 20 '24
·
How Infinite Queries workHow Infinite Queries work
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

How Infinite Queries work

A serious bug report about infinite queries led me to question it's architecture, but it all turned out fine in the end ...

·
Sep 13 '24
·
Nathan Walker, Eduardo Speroni - NativeScript
Devtools FM icon
Devtools FM
devtools.fm

Nathan Walker, Eduardo Speroni - NativeScript

Nathan Walker and Eduardo Speroni dive into NativeScript's ability to bridge JavaScript with native platform APIs for cross-platform mobile development.

·
Jul 27 '24
·
React 19 and Suspense - A Drama in 3 ActsReact 19 and Suspense - A Drama in 3 Acts
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

React 19 and Suspense - A Drama in 3 Acts

React 19 is a very promising release - but there's something not quite right yet with suspense...

·
Jun 15 '24
·
Automatic Query Invalidation after MutationsAutomatic Query Invalidation after Mutations
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Automatic Query Invalidation after Mutations

Even though there is nothing built into React Query, it doesn't need a lot of code to implement automatic query invalidation in user-land thanks to the global cache callbacks.

·
May 24 '24
·
Zustand and React ContextZustand and React Context
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Zustand and React Context

Zustand stores a global and don't need React Context - but sometimes, it makes sense to combine them regardless.

·
Apr 13 '24
·
Using Shadcn-ui with Inertia and AdonisJS
M
Matteo Gassend
matteogassend.com

Using Shadcn-ui with Inertia and AdonisJS

·
Mar 25 '24
·
Avoiding Hydration Mismatches with useSyncExternalStoreAvoiding Hydration Mismatches with useSyncExternalStore
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Avoiding Hydration Mismatches with useSyncExternalStore

Avoiding hydration mismatches can usually be done in two ways - suppressing the warning or spawning an effect. But is there a third option ... ?

·
Feb 20 '24
·
The Query Options APIThe Query Options API
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

The Query Options API

v5 brought a new, powerful API, especially if you're using React Query with TypeScript...

·
Jan 16 '24
·
Why You Want React QueryWhy You Want React Query
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Why You Want React Query

Let's take a look at why you'd want a library like React Query, even if you don't need all the extra features it provides...

·
Nov 6 '23
·
The Uphill Battle of MemoizationThe Uphill Battle of Memoization
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

The Uphill Battle of Memoization

Exploring why React.memo shouldn't be your first choice for performance optimizations

·
Sep 29 '23
·
React Query and React ContextReact Query and React Context
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

React Query and React Context

Can it make sense to combine React Query with React Context ? Yes, sometimes ...

·
Jul 21 '23
·
Appwrite Hackaton: MoviePlay
M
Matteo Gassend
matteogassend.com

Appwrite Hackaton: MoviePlay

·
Jun 9 '23
·
Thinking in React QueryThinking in React Query
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Thinking in React Query

In this talk, we will learn how a different mindset can help us understand React Query and work with it efficiently.

·
Jun 6 '23
·
You Might Not Need React QueryYou Might Not Need React Query
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

You Might Not Need React Query

React Query is a great library, but like any tool, you should choose it for the right problem

·
May 19 '23
·
Breaking React Query's API on purposeBreaking React Query's API on purpose
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Breaking React Query's API on purpose

Why good API design matters, even if it means breaking existing APIs in the face of resistance.

·
Apr 15 '23
·
Why React isn't dyingWhy React isn't dying
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Why React isn't dying

Finishing my train of thought about why React is here to stay (for now).

·
Jan 28 '23
·
Type-safe React QueryType-safe React Query
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Type-safe React Query

About the difference between "having types" and "being type-safe"...

·
Jan 6 '23
·
Inside React QueryInside React Query
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Inside React Query

Taking a look under the hood of React Query

·
Dec 2 '22
·
Working with ZustandWorking with Zustand
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Working with Zustand

Let's dive into some tips for working with Zustand - one of my favourite client state management libraries in React.

·
Nov 19 '22
·
Seeding the Query CacheSeeding the Query Cache
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Seeding the Query Cache

With suspense for data fetching on the horizon, it is now more important than ever to make sure your cache is seeded properly to avoid fetch waterfalls.

·
Oct 21 '22
·
Refs, Events and Escape HatchesRefs, Events and Escape Hatches
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Refs, Events and Escape Hatches

Refs can provide a way to sidestep dependency arrays without violating any rules, and the proposed useEvent hook might make working with functions and effects a lot easier...

·
Sep 16 '22
·
React Query meets React RouterReact Query meets React Router
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

React Query meets React Router

React Query and React Router are a match made in heaven.

·
Aug 27 '22
·
Avoiding useEffect with callback refsAvoiding useEffect with callback refs
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Avoiding useEffect with callback refs

Interacting with DOM nodes doesn't necessarily need useEffect

·
Aug 13 '22
·
React Query FAQsReact Query FAQs
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

React Query FAQs

Answering the most frequently asked React Query questions

·
Jun 23 '22
·
Hooks, Dependencies and Stale ClosuresHooks, Dependencies and Stale Closures
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Hooks, Dependencies and Stale Closures

Let's demystify what stale closures are in combination with react hooks with the help of the analogy of taking a photo ...

·
Apr 23 '22
·
React Query and FormsReact Query and Forms
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

React Query and Forms

Forms tend to blur the line between server and client state, so let's see how that plays together with React Query.

·
Apr 9 '22
·
optional vs. undefinedoptional vs. undefined
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

optional vs. undefined

There is a subtle difference between optional fields and required, but potentially undefined ones.

·
Feb 18 '22
·
Offline React QueryOffline React Query
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Offline React Query

A glimpse at what v4 will bring for offline queries

·
Feb 4 '22
·
Hook, line, and sinker
M
Matteo Gassend
matteogassend.com

Hook, line, and sinker

·
Jan 24 '22
·
Beware the leaking anyBeware the leaking any
TkDodo's blog icon
TkDodo's blog
tkdodo.eu

Beware the leaking any

Any is not among my favourite TypeScript types, but it is the one you will inevitably encounter. Let's see what makes it so dangerous.

·
Dec 3 '21
·