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

Upgrade useSyncExternalStore to alpha channel #22662

Merged
merged 2 commits into from
Oct 31, 2021

Commits on Oct 31, 2021

  1. Move useSyncExternalStore shim to a nested entrypoint

    Also renames `useSyncExternalStoreExtra` to
    `useSyncExternalStoreWithSelector`.
    
    - 'use-sync-external-store/shim' -> A shim for `useSyncExternalStore`
      that works in React 16 and 17 (any release that supports hooks). The
      module will first check if the built-in React API exists, before
      falling back to the shim.
    - 'use-sync-external-store/with-selector' -> An extended version of
      `useSyncExternalStore` that also supports `selector` and `isEqual`
      options. It does _not_ shim `use-sync-external-store`; it composes the
      built-in React API. **Use this if you only support 18+.**
    - 'use-sync-external-store/shim/with-selector' -> Same API, but it
      composes `use-sync-external-store/shim` instead. **Use this for
      compataibility with 16 and 17.**
    - 'use-sync-external-store' -> Re-exports React's built-in API. Not
      meant to be used. It will warn and direct users to either the shim or
      the built-in API.
    acdlite committed Oct 31, 2021
    Configuration menu
    Copy the full SHA
    2e0d0c1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    14d177f View commit details
    Browse the repository at this point in the history