Skip to content
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

Prerendering support for useDeferredValue #27512

Merged
merged 1 commit into from
Oct 17, 2023

Commits on Oct 17, 2023

  1. Prerendering support for useDeferredValue

    Revealing a prerendered tree (hidden -> visible) is considered the same
    as mounting a brand new tree. So, when an initialValue argument is
    passed to useDeferredValue, and it's prerendered inside a hidden tree,
    we should first prerender the initial value.
    
    After the initial value has been prerendered, we switch to prerendering
    the final one. This is the same sequence that we use when mounting new
    visible tree. Depending on how much prerendering work has been finished
    by the time the tree is revealed, we may or may not be able to skip all
    the way to the final value.
    
    This means we get the benefits of both prerendering and preview states:
    if we have enough resources to prerender the whole thing, we do that.
    If we don't, we have a preview state to show for immediate feedback.
    acdlite committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    f31fcd1 View commit details
    Browse the repository at this point in the history