This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround nested React renderers without useSyncExternalStore() supp…
…ort (#2001) Summary: Pull Request resolved: #2001 Recoil will attemp to detect if `useSyncExternalStore()` is supported before calling it. However, sometimes the host environment supports it but creates additional React renderers, such as with `react-three-fiber`, which do not. Since React goes through a proxy dispatcher we can't simply check if `useSyncExternalStore()` is defined. Thus, this workaround will catch the situation and fallback to using `useState()` and `useEffect()`. Reviewed By: habond Differential Revision: D39329856 fbshipit-source-id: 6e4e853d4f3d758b4171ac49cab9fbb1170f66b4
- Loading branch information
1 parent
b974a03
commit d04dd35
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
* @format | ||
* @oncall recoil | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const React = require('react'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters