Skip to content

Tanstack v9 still doesn't really support react compiler #6577

Description

@GabbeV

TanStack Table version

9.1.2

Framework/Library version

React 19.2.8

Describe the bug and the steps to reproduce it

Tanstack table uses internally mutable state, something that goes against Reacts immutability assumptions. This creates issues with the react compiler. v9 tries to make it work with the compiler by making the table object a non stable object. This happens to work out in many cases, not because it now follows the rules of react but because exactly how the compiler currently reason about those rules often shake out that way. Depending on internal implementation details like this and advocating for your users to leave the compiler on for components using tanstack table seem irresponsible as a future version of the compiler could suddenly break your users apps.

The attached stackblitz shows how sending a value to a completely unrelated hook can cause react compiler to make different decisions, breaking something that previously worked out. To me this demonstrates that what tanstack table is doing is still fundamentally breaking the react compilers rules and could break at any time.

This is causing issues with Octane as well as it wants to rely on similar assumptions as the react compiler for its optimizations. That is probably not your issue to solve but mentioning it as well as it was through investigating weird decisions around memoization in Octane that I discovered this issue. octanejs/octane#846 (comment)

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://stackblitz.com/edit/vitejs-vite-deapj37r?file=src%2FApp.tsx

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions