Skip to content

Cascader virtual rows can become stale with React Compiler #134

Description

@focus0802

Summary

The virtualized Cascader can render a stale initial window when React Compiler is enabled.

Reproduction

  1. Enable React Compiler for the installed Cascader source.
  2. Render the official virtualized Cascader example with enough items to require scrolling.
  3. Scroll the list substantially.

The scroll position changes, but the rendered virtual rows may remain the initial window, leaving blank space or missing items.

Cause

The virtualizer object keeps a stable identity while getVirtualItems() returns data that changes after scrolling. Compiler memoization of the consuming renderer can therefore reuse an outdated result. Skipping compilation of the wrapped hook alone does not protect its consuming components.

Expected

Virtual rows update after scrolling with React Compiler enabled.

Environment

React 19, React Compiler, @tanstack/react-virtual, ReUI Cascader virtual example.

Proposed Fix

PR #135 adds "use no memo" to the two consuming virtual row renderers in both the Base UI and Radix implementations.

The PR includes validation details and the remaining registry-generation limitation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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