react / react/react-native

`requestIdleCallback` is not defined in TS types

オープン 初心者向け
#58,565 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Needs: Triage :mag:
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

Description

The v0.87 announcement says that InteractionManager has been removed (https://github.com/react/react-native/pull/57394) and we should use requestIdleCallback instead. The only issue with that is that when I put a call to requestIdleCallback in the code TypeScript spits out the error Cannot find name 'requestIdleCallback'., which means we can't actually use requestIdleCallback without breaking the TypeScript build.

Steps to reproduce
  1. Update to React Native 0.87
  2. Try to call requestIdleCallback
React Native Version

0.87.1

Affected Platforms

Build - MacOS

Output of npx @react-native-community/cli info
info Fetching system and libraries information...
System:
  OS: macOS 26.7
  CPU: (14) arm64 Apple M4 Pro
  Memory: 258.31 MB / 48.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.16.0
    path: /Users/<redacted>/.nvm/versions/node/v24.16.0/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 11.13.0
    path: /Users/<redacted>/.nvm/versions/node/v24.16.0/bin/npm
  Watchman:
    version: 2026.07.27.00
    path: /run/current-system/sw/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.5
      - iOS 26.5
      - macOS 26.5
      - tvOS 26.5
      - visionOS 26.5
      - watchOS 26.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.26094.121.2512.13930704
  Xcode:
    version: 26.6/17F113
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.19
    path: /run/current-system/sw/bin/javac
  Ruby:
    version: 2.7.8
    path: /Users/<redacted>/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.2.0
    wanted: 20.2.0
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.87.1
    wanted: 0.87.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
path/to/problem/file.ts:36:20 - error TS2304: Cannot find name 'requestIdleCallback'.

36       const task = requestIdleCallback(() => {
                      ~~~~~~~~~~~~~~~~~~~
MANDATORY Reproducer

https://github.com/simon-abbott/rn-bug-idle-callback-type-missing

Screenshots and Videos

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

https://github.com/simon-abbott/rn-bug-idle-callback-type-missing の必須の再現コードから始め、requestIdleCallback に関連する React Native 0.87 の TypeScript 宣言を調査してください。requestIdleCallback の呼び出しが TS2304 エラーなしで正常に型チェックされれば、Issue は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react-native, typescript
領域
mobile
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
82/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。