AppTable remounting children on table state updates in composable tables #6323
Send to my agentTanStack Table version#
v9
Framework/Library version#
NextJS 16
Describe the bug and the steps to reproduce it#
AppTable appears to remount its children whenever table state changes.
This breaks table-level UI such as toolbars with controlled inputs. For example, an input that updates globalFilter loses focus after every keystroke because the toolbar subtree is remounted.
Minimal repro:
function Toolbar() {
const table = useTableContext()
return (
<input
value={table.state.globalFilter ?? ""}
onChange={(e) => table.setGlobalFilter(e.target.value)}
/>
)
}
Rendered inside:
<table.AppTable>
<table.Toolbar />
{...}
</table.AppTable>
Expected: AppTable should preserve child identity across table state updates.
Actual: children are remounted after each table state update.
This issue is also visible in the composable tables example.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)#
Screenshots or Videos (Optional)#
No response
Do you intend to try to help solve this bug with your own PR?#
No, because I do not know how
Terms & Code of Conduct#
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
fixed in the latest beta
KevinVandy closed this
Sign in to join this conversation.
Hey @wildsonc , Iv'e opened a PR for this : https://github.com/TanStack/table/pull/6331. Whenever you have a moment, I'd love your feedback on the implementation