Skip to content

fix controlled state handling for undefined options#6436

Closed
KevinVandy wants to merge 1 commit into
betafrom
agent/fix-undefined-controlled-state
Closed

fix controlled state handling for undefined options#6436
KevinVandy wants to merge 1 commit into
betafrom
agent/fix-undefined-controlled-state

Conversation

@KevinVandy

Copy link
Copy Markdown
Member

What changed

  • treat explicitly undefined top-level options as omitted when resolving and updating table options
  • ignore undefined values in legacy controlled state synchronization
  • add a regression test covering optional controlled state and callback props passed through a wrapper

Why

Wrapper components commonly forward optional state and change callback props. Previously, an explicit undefined state slice overwrote the table's valid base atom, while an explicit undefined callback replaced the feature's default internal updater. Either value could accidentally freeze an otherwise uncontrolled state slice.

This keeps defined controlled values unchanged while making undefined behave like an omitted optional prop.

Validation

  • pnpm exec vitest run packages/table-core/tests/unit/core/tableAtoms.test.ts (11 tests)
  • pnpm nx run @tanstack/table-core:test:lib --run (52 files, 1002 tests)
  • pnpm nx run @tanstack/table-core:test:types
  • ESLint on changed files
  • git diff --check

Closes #4764

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f5fc1b1a-49a3-475c-969d-8bf03eaa6e9d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-undefined-controlled-state

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 17, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 320c367

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 4m 30s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 47s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-17 20:34:28 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown
More templates

@tanstack/alpine-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/alpine-table@6436

@tanstack/angular-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table@6436

@tanstack/angular-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table-devtools@6436

@tanstack/ember-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/ember-table@6436

@tanstack/lit-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/lit-table@6436

@tanstack/match-sorter-utils

npm i https://pkg.pr.new/TanStack/table/@tanstack/match-sorter-utils@6436

@tanstack/preact-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table@6436

@tanstack/preact-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table-devtools@6436

@tanstack/react-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table@6436

@tanstack/react-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table-devtools@6436

@tanstack/solid-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table@6436

@tanstack/solid-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table-devtools@6436

@tanstack/svelte-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/svelte-table@6436

@tanstack/table-core

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-core@6436

@tanstack/table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-devtools@6436

@tanstack/vue-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table@6436

@tanstack/vue-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table-devtools@6436

commit: 320c367

@KevinVandy KevinVandy closed this Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

controlled / uncontrolled state the treatment of undefined

1 participant