react/production-readiness

Optimize TanStack Table v9 React UIs with narrow selectors and stable references.

28.3k|3.6k|Updated Oct 20, 2016
One-click install
npx skills add https://github.com/TanStack/table --skill react-production-readiness-tanstack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react/production-readiness
Source: https://github.com/TanStack/table/tree/main/packages/react-table/skills/react/production-readiness
Command: npx skills add https://github.com/TanStack/table --skill react-production-readiness-tanstack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents React Table apps from wasting CPU cycles and triggering unnecessary re-renders by guiding you to apply production-grade optimization patterns to TanStack Table v9.

Core Features & Use Cases

  • Tree-shake _features: Register only the features you actually render to reduce bundle size.
  • Stabilize identities: Memoize or hoist _features, _rowModels, columns, and data so internal memoization works reliably.
  • Narrow subscriptions: Replace broad (state) => state selectors with slice-level selectors and push re-render boundaries down using <table.Subscribe> and useSelector(table.atoms.<slice>).

Quick Start

Use the react/production-readiness skill to refactor your useTable setup by registering only the _features you use, hoisting stable columns/data references, and wrapping heavy UI like the table body to re-render only when the specific slices it needs change.

Frequently Asked Questions about react/production-readiness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce wasted re-renders in TanStack Table v9?

Reduce wasted re-renders in TanStack Table by replacing broad `(state) => state` selectors with narrow slice-level selectors. Use `<table.Subscribe>` and `useSelector(table.atoms.<slice>)` to isolate re-render boundaries for heavy table body rendering.

Why does my React table re-render unnecessarily when state changes?

Unnecessary React table re-renders occur when stable reference identities are lost. Memoize or hoist `_features`, `_rowModels`, `columns`, and `data` outside your component so internal memoization works reliably across renders.

How do I reduce React table bundle size with tree shaking?

Reduce React table bundle size by registering only the `_features` you actually render. Tree-shake unused features from your `useTable` setup to eliminate dead code and minimize the final production bundle footprint.

Can I use fine-grained subscriptions for sorting and pagination slices in React?

Yes, you can use fine-grained subscriptions for sorting and pagination slices in React. Replace broad state selectors with atom-level subscriptions using `useSelector(table.atoms.<slice>)` to ensure components only re-render when their specific slice changes.

What's the best way to optimize TanStack Table for production?

Optimize TanStack Table for production by combining tree-shaken `_features`, stable reference identities for `columns` and `data`, and narrow subscriptions via `<table.Subscribe>` boundaries to reduce wasted renders and bundle size.

Do I need stable references for table columns and data to prevent re-renders?

Yes, stable references for table `columns` and `data` are required. Without stable identity, internal memoization fails, causing the table to recompute row models and trigger unnecessary re-renders across your entire React UI.