【问题标题】:react-native white screen after splash until I make a change in code飞溅后反应原生白屏,直到我更改代码
【发布时间】:2021-09-07 11:32:52
【问题描述】:

在启动画面后,我的 react-native 应用程序出现白屏。但是,如果然后我从项目中的任何文件中点击 command+s 来保存它(无论是否更改),应用程序都会刷新然后加载正常,没问题。然后,如果我要从 Metro 控制台重新加载 (command+r),我只会再次出现白屏,直到我保存其他内容。

我无法弄清楚我可能更改了什么或为什么会触发此事件,尊重所有最近的更改仍然没有任何区别。有没有人经历过这种情况?

我唯一的控制台输出是:

 WARN  Require cycle: node_modules/react-native-maps/lib/components/MapView.js -> node_modules/react-native-maps/lib/components/Geojson.js -> node_modules/react-native-maps/lib/components/MapView.js

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. 
    at App (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=uk.co.dropless&modulesOnly=false&runModule=true:166115:78)
    at HeadlessCheck (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=uk.co.dropless&modulesOnly=false&runModule=true:1368:26)
    at RCTView
    at View
    at RCTView
    at View
    at AppContainer (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=uk.co.dropless&modulesOnly=false&runModule=true:76239:36)

【问题讨论】:

  • 您有任何显示问题的视频/录音吗?

标签: javascript reactjs typescript react-native


【解决方案1】:

在您的应用程序中进行循环导入的某些地方

假设你有“File1.js”和“File2.js”

在 File1.js 中

import File2 from "./File2"

在 File2.js 中

import File1 from "./File1"

【讨论】:

  • 啊,我明白了,警告说的是什么,看起来它警告的那个是在 node_modules 中,但不确定这是否超出我的控制
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-04-21
  • 1970-01-01
  • 2021-04-04
  • 1970-01-01
相关资源
最近更新 更多