Skip to content
Source
Sign inSign up
TanStack/table

fix(vue-table): render nothing for an empty string cell #6590

OpenYash121l(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/6590/headopened

🎯 Changes

Fixes #6077.

flexRender passes primitives straight through, so a cell or header whose value is an empty string produces an empty text vnode. Vue's server renderer emits nothing for it while the client creates a text node, so hydration reports Hydration children mismatch inside the <td>.

flexRender now returns null for an empty string, in both the direct path and the path that runs a render function, which is how it already treats null and undefined. React's flexRender does not have this problem because React renders an empty string as nothing on both the server and the client, so this brings the Vue adapter in line with it.

The new test at packages/vue-table/tests/unit/flexRenderHydration.test.ts renders a one-cell table with renderToString, hydrates a client app into that markup and asserts no hydration warning is logged. On main it fails with [Vue warn]: Hydration children mismatch on.

@tanstack/vue-table passes test:lib, test:types, test:eslint, test:build and build. pnpm test:pr passes for all 41 affected projects, and the affected Vue example e2e suites pass.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm test and pnpm test:e2e, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Sign in to join this conversation.