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

Initial shim of useSyncExternalStore #22211

Merged

Commits on Sep 2, 2021

  1. Initial shim of useSyncExternalStore

    This sets up an initial shim implementation of useSyncExternalStore,
    via the use-sync-external-store package. It's designed to mimic the
    behavior of the built-in API, but is backwards compatible to any version
    of React that supports hooks.
    
    I have not yet implemented the built-in API, but once it exists, the
    use-sync-external-store package will always prefer that one. Library
    authors can depend on the shim and trust that their users get the
    correct implementation.
    
    See reactwg/react-18#86 for background
    on the API.
    
    The tests I've added here are designed to run against both the shim and
    built-in implementation, using our variant test flag feature. Tests that
    only apply to concurrent roots will live in a separate suite.
    acdlite committed Sep 2, 2021
    Configuration menu
    Copy the full SHA
    505c398 View commit details
    Browse the repository at this point in the history