react / react/react-native

Image component network requests do not appear in Network DevTools on Android/iOS

未关闭
#55,184 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Component: Image Debugging Needs: Attention Needs: Repro Platform: Android Platform: iOS
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

Network requests initiated by the React Native Image component (i.e., image source fetches) never appear in Network DevTools, even though the documentation states that this behavior is expected and supported (see https://reactnative.dev/docs/react-native-devtools -> Network Event Coverage). Issue is present on both Android and iOS.

Simple reproduction code:

function AppContent() {
  const [showImage, setShowImage] = useState(false);

  return (
    <View style={styles.container}>
      <Button
        onPress={() => setShowImage(true)}
        title="Show Image"
      />
      {showImage && (
        <Image
          source={{ uri: 'https://cataas.com/cat' }}
          style={styles.image}
        />
      )}
    </View>
  );
}
Steps to reproduce
  1. Install React Native application via React Native Community CLI
  2. Launch the app, then the DevTools, open Network tab
  3. Create an Image component with source set as external url (for example https://cataas.com/cat)
React Native Version

0.84.0-rc.1 and earlier

Output of npx @react-native-community/cli info
System:
  OS: macOS 15.6.1
  CPU: (8) arm64 Apple M1 Pro
  Memory: 214.00 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.19.4
    path: /Users/pawel/.nvm/versions/node/v20.19.4/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.2
    path: /Users/pawel/.nvm/versions/node/v20.19.4/bin/npm
  Watchman:
    version: 2025.06.30.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/pawel/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.2
      - iOS 26.2
      - macOS 26.2
      - tvOS 26.2
      - visionOS 26.2
      - watchOS 26.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.2 AI-252.28238.7.2523.14608894
  Xcode:
    version: 26.2/17C52
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.15
    path: /usr/bin/javac
  Ruby:
    version: 3.1.0
    path: /Users/pawel/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: latest
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.84.0-rc.1
    wanted: 0.84.0-rc.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Screenshots and Videos

https://github.com/user-attachments/assets/392907dd-1736-4eba-b9b7-b96f5bd009ae

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 React Native DevTools 文档的 Network Event Coverage 开始,并在 Android 和 iOS 上分别复现外部 Image URL 请求。跟踪 Image 组件发起的 fetch 如何呈现在 Network DevTools 中,然后确认该请求在两个平台的 Network 标签页中都能显示。对于提供的复现,文档所述行为能够正常工作即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
react-native
领域
devtools, mobile, networking
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。