TanStack / table

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table
https://tanstack.com/table
MIT License
24.5k stars 3.03k forks source link

Table doesn’t re-render with new React Compiler + React 19 #5567

Open erikshestopal opened 1 month ago

erikshestopal commented 1 month ago

TanStack Table version

v8.17.3

Framework/Library version

React 19 + React Compiler

Describe the bug and the steps to reproduce it

In the repo provided, run bun install and then bun dev.

Then, add some text to the input and click add. Observe that the table doesn’t re-render when the data passed in has changed (table.getRowModel().rows doesn’t seem to be updated).

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://github.com/erikshestopal/react-compiler-bug/blob/a92305ca44ee81b6d7ece76c96aacf163fe83970/src/App.tsx#L38

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms & Code of Conduct

jonahallibone commented 1 month ago

This is unsurprising. This library (which I love) has been complicated to optimize since at least v7. They core instance returned from useReactTable doesn't rerender as one would expect in React, which means that the memoiziation that the compiler applies certainly breaks this library. I wouldn't expect a fix until v9.

yongsk0066 commented 1 month ago

I am also having difficulty applying the compiler due to the same issue. I am concerned that other libraries might have similar issues, making the application of the compiler worrisome.

SaveliiLukash commented 1 month ago

Same exact issue. We'll have to stick with "use no memo" directive for now for our table component.

KevinVandy commented 1 month ago

Yep, use no memo on table components for now. A v9 alpha branch was recently created where we will focus on version bumping the peer dependencies for each framework that needs it.

izakfilmalter commented 3 days ago

Seems like doing the following solves it for me: https://github.com/TanStack/virtual/issues/743