Skip to content

Running virtual examples with React 18 createRoot causes rendering lag #549

@bwamsellem

Description

@bwamsellem

Describe the bug

I have tested the examples/react/fixed example with React 18, so changed the init code to use the new createRoot / render API:

ReactDOM.render( , document.getElementById('root'))
=>
ReactDOM.createRoot( document.getElementById('root')).render( )

Before: the scrolling is super smooth,
After: you can notice an important lag ( white flickering) while scrolling through rows or grid.

Is this caused by the concurrent rendering of React 18?

Your minimal, reproducible example

https://react-ts-mfeisb.stackblitz.io

Steps to reproduce

  1. Run the example in dev mode

Expected behavior

Smooth scrolling

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Windows 10 + Chrome 113

tanstack-virtual version

3.0.0-beta.54

TypeScript version

4.4.2

Additional context

No response

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