Commit 47b45df
Make sure the Native RuntimeScheduler is initialized on Old Arch (#37517)
Summary:
Pull Request resolved: #37517
Fixes #35778
We got reports of regressions on `useEffect` starting from 0.69+ when on Hermes.
The issue seems to be caused by a bump of the `scheduler` package from 0.20 to 0.21.
In scheduler@0.21, the method `setImmediate` gets called if available
(see facebook/react#20834). This causes React Native to use Microtasks
which ends up in changing the semantic of useEffect.
The solution is to use the Native RuntimeScheduler properly.
On Paper specifically, we never initialized it as it's effectively initialized by the
TurboModuleManagerDelegate. Here I trigger the initialization of it on Paper as well.
Changelog:
[Android] [Fixed] - Make sure the Native RuntimeScheduler is initialized on Old Arch
Reviewed By: sammy-SC
Differential Revision: D46024807
fbshipit-source-id: d72cd774df58410467644cddeaaf37e3c227b5051 parent cddcf09 commit 47b45df
File tree
2 files changed
+16
-0
lines changed- packages/react-native/ReactAndroid/src/main/java/com/facebook/react
- config
2 files changed
+16
-0
lines changedLines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1360 | 1360 | | |
1361 | 1361 | | |
1362 | 1362 | | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
1363 | 1372 | | |
1364 | 1373 | | |
1365 | 1374 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| |||
0 commit comments