Skip to content
Source
Sign inSign up
TanStack/table

AppTable remounting children on table state updates in composable tables #6323

Send to my agent
Closedwildsonc(GitHub profile, opens in a new tab) opened this issue 2 comments

TanStack 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.

https://stackblitz.com/github/tanstack/table/tree/beta/examples/react/composable-tables?embed=1&theme=dark&preset=node&file=src/main.tsx

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.
  1. 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

  2. fixed in the latest beta

  3. KevinVandy closed this

Sign in to join this conversation.