Skip to content

React 18 : Possible Transition use case? Rendering large table with filtered tabs #21696

@ksaldana1

Description

@ksaldana1

Apologies if this is an inappropriate place to ask this type of question. When reading about React 18, in particular the startTransition API, I started thinking of problems I've run into in the past where I had to do lots of manual management of renders to provide good UX. I tried to recreate the original problem (at least a contrived version of it) in a CodeSandbox:

https://codesandbox.io/s/usetransition-tab-test-575cu?file=/src/App.js

I attempted to describe the problem in the sandbox, but basically I am trying to optimize the interaction and navigation of the Tab components onClick—the "high priority" update—and defer the rendering of the table data (through a loading spinner or delay of table data rendering).

Reading through the startTransition explanation, I'm not sure if this an appropriate use case. My tab component is not a native browser component, and it seems that I only have the ability to mark "low-priority" updates and not the opposite (eg. wrapping handleClick as a high-priority update).

I was hoping to get some clarification if my mental model is off here. I am aware there are other ways to deal with this problem (eg. list virtualization), but I'm mostly trying to understand the scope of the startTransition API.

Thanks for all the hard work! I'm very excited about the new developments in React 18 and appreciate your team's commitment to pragmatism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    React 18Bug reports, questions, and general feedback about React 18Type: Discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions