fix controlled state handling for undefined options#6436
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
View your CI Pipeline Execution ↗ for commit 320c367
☁️ Nx Cloud last updated this comment at |
What changed
undefinedtop-level options as omitted when resolving and updating table optionsundefinedvalues in legacy controlledstatesynchronizationWhy
Wrapper components commonly forward optional state and change callback props. Previously, an explicit
undefinedstate slice overwrote the table's valid base atom, while an explicitundefinedcallback 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
undefinedbehave 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:typesgit diff --checkCloses #4764