Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

feat(hooks): migrate to useSyncExternalStore() #3489

Merged
merged 4 commits into from
Jun 1, 2022

Conversation

francoischalifour
Copy link
Member

@francoischalifour francoischalifour commented May 31, 2022

Note
This is in the PR series that brings support for React 18.

Description

This updates the implementation in <InstantSearch> from an effect to the useSyncExternalStore() API. This Hook is meant to support new concurrent and time slicing features of React 18.

This is using a shim that backports the behavior to all React versions from 16.8.0 (the one that provides Hooks).

Together with algolia/instantsearch#5056, we should have the certainty to support concurrent features with a minimum amount of network requests.

Related

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 31, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6e755ce:

Sandbox Source
react-instantsearch-app Configuration
routing-basic Configuration
hooks-example Configuration

@netlify
Copy link

netlify bot commented May 31, 2022

Deploy Preview for react-instantsearch ready!

Name Link
🔨 Latest commit 6e755ce
🔍 Latest deploy log https://app.netlify.com/sites/react-instantsearch/deploys/62973605ab94f4000ba00a2a
😎 Deploy Preview https://deploy-preview-3489--react-instantsearch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

babel.config.js Outdated Show resolved Hide resolved
Co-authored-by: Haroen Viaene <hello@haroen.me>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants