-
-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Disable / control unmounting of already mounted rows #234
Comments
I don't think that sounds like something I want to support directly. It sounds like a reasonable use case, I just don't think I want to take on the extra complexity. You could perhaps implement this behavior by supplying your own react-window/src/createListComponent.js Lines 324 to 331 in f2b2106
But this would require some hacky duplication of this code: react-window/src/createListComponent.js Lines 285 to 298 in f2b2106
|
Out of curiosity: |
Keeping react components mounted is pretty much the same as DOM reuse. PS: Oh yeah another option for "DOM reuse" might be a way to make the virtual scrolling reuse the item keys. PPS: Actually I think this idea might be worth a try to see what performance benefits can me achieved with such a solution - I guess it could be tried out by adding a third parameter containing this kinda "window-static-key" here: https://github.com/bvaughn/react-window/blob/master/src/createListComponent.js#L305 |
@olee Using custom keyProvider and modulo i'm able to (almost) keep using same keys, and rotating them. I think the idea behind it works, |
I have the same problem here... |
Since this is something React intends to provide support for natively with a future Offscreen API, I don't think a library like react-window should try to implement this itself. |
This is actually something that is causing some pain in the project I'm working on. I have a table where you can select and deselect rows and obviously they change background color. For a long time I couldn't understand why none of my CSS transitions were working until I realised that Is there any reason why everything has to be destroyed when things that are not even relevant to virtualization change? |
Agree with @codeaid . It's also a big pain point for a project I am a part of. |
Having the exact same problem as @codeaid with a List, is there any way around this? |
Same here, big pain. @codeaid |
hi, did anybody found nice workaround? I have very expensive initial rendering and I am looking for the way to avoid unmounting |
|
@CarlosVergikosk hi, I was checking virtuoso, but there is the same thing, everythig is unmounted on scroll |
I would like to suggest an option to control the unmounting of already mounted rows.
This could give a performance boost to lists with a moderate amount of large rows but which are very expensive to render.
If properly handled (rows should use memo of course) it would only render rows the first time they are visible and then keep them mounted to be able to scroll back to them again without needing to render them again.
What do you think of this suggestion?
Might there be a way to do this with current react-window (or maybe react-virtualized?) right now?
The text was updated successfully, but these errors were encountered: