Closed
Description
Description
requestIdleCallback
is never called on iOS. On a debug or release mode the behavior is the same. On Android it still work as expected.
The only way for requestIdleCallback
to be called on iOS is by providing an timeout option (but all called of requestIdleCallback
will be with didTimeout
…).
It's a regression in 0.62.X, it worked well on 0.61.5 (and since, at least, 0.47.X on my own app).
React Native version:
System:
OS: macOS 10.15.4
CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
Memory: 21.85 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.14.1 - /var/folders/68/7qlptmf573d5fzhxlhc6tfvm0000gn/T/yarn--1586712574681-0.7718023604103352/node
Yarn: 1.19.1 - /var/folders/68/7qlptmf573d5fzhxlhc6tfvm0000gn/T/yarn--1586712574681-0.7718023604103352/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.8.4 - /Users/freddy/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 23.0.3, 24.0.3, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.1, 28.0.2, 28.0.3, 29.0.2, 29.0.3
System Images: android-23 | Intel x86 Atom, android-23 | Intel x86 Atom_64, android-23 | Google APIs ARM EABI v7a, android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-25 | Google APIs ARM EABI v7a, android-25 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom_64, android-25 | Google Play Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 11.4/11E146 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_111 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
- Create a fresh new react-native app and install the js dependencies and pods. (I used https://github.com/react-native-community/rn-diff-purge/tree/release/0.62.2/RnDiffApp)
- On App.js, inside or outside a function component:
requestIdleCallback(()=> {
console.log("Never called on iOS, only on Android");
});
Expected Results
Expect to requestIdleCallback
work as expected.
Snack, code example, screenshot, or link to a repository:
Expo/Snack is not yet on 0.62, the best way is to create a new project with react native cli or by cloning https://github.com/react-native-community/rn-diff-purge/tree/release/0.62.2/RnDiffApp
Thank you