mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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 https://github.com/reactwg/react-18/discussions/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.
23 lines
529 B
JSON
23 lines
529 B
JSON
{
|
|
"name": "use-sync-external-store",
|
|
"description": "Backwards compatible shim for React's useSyncExternalStore. Works with any React that supports hooks.",
|
|
"version": "0.0.1",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/facebook/react.git",
|
|
"directory": "packages/use-sync-external-store"
|
|
},
|
|
"files": [
|
|
"LICENSE",
|
|
"README.md",
|
|
"build-info.json",
|
|
"index.js",
|
|
"extra.js",
|
|
"cjs/"
|
|
],
|
|
"license": "MIT",
|
|
"peerDependencies": {
|
|
"react": "^16.8.0 || ^17.0.0"
|
|
}
|
|
}
|