升级到RN 0.30后,我开始看到下面显示的错误,即使是在构建尽可能简单的app:

react-native init AwesomeProject
react-native run-ios
  • 最奇怪的是,组件BlurViewVibrancyViewRNSearchBar包含在警告消息中,尽管项目没有使用它们.
  • 重新编译/清理项目并不能解决问题.

控制台及;错误:

2016-07-22 08:48:02.985 [warn][tid:main][RCTEventEmitter.m:52] Sending `websocketFailed` with no listeners registered.
2016-07-22 08:48:03.031 [warn][tid:com.facebook.react.JavaScript] Warning: Native component for "BlurView" does not exist
2016-07-22 08:48:03.032 [warn][tid:com.facebook.react.JavaScript] Warning: Native component for "VibrancyView" does not exist
2016-07-22 08:48:03.033 [warn][tid:com.facebook.react.JavaScript] Warning: Native component for "RNSearchBar" does not exist
2016-07-22 08:48:03.040 [error][tid:com.facebook.react.JavaScript] `Constructor` has no propType for native prop `RCTView.maxHeight` of native type `CGFloat`
If you haven't changed this prop yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.
2016-07-22 08:48:03.043 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: `Constructor` has no propType for native prop `RCTView.maxHeight` of native type `CGFloat`
If you haven't changed this prop yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.
2016-07-22 08:48:03.102 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module.
2016-07-22 08:48:03.104 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Module AppRegistry is not a registered callable module.

screenshot

推荐答案

这个错误的原因是,在我更新到0.30之后,React packager的另一个实例(仍然在0.28上)正在后台运行.

重新启动React packager解决了这个问题.

Reactjs相关问答推荐

如何使用react-router-dom导航到网页中的其他路由?

如何防止使用useCallback和memo重新渲染

避风港访问端口以包含Reaction应用程序

单击空白区域时,Reaction Multiple下拉组件不关闭

一键MUI导出

获取未捕获的错误:Gatsby生产版本上的最小化react 错误#418

GitHub页面未正确显示Reaction应用程序网站

useEffect firebase 清理功能如何工作?

在 React 中是否有任何理由要记住 Redux 操作创建者?

如何解决使用react-hook-form和yup动态创建的输入不集中的问题

如何在 ChartJS 中创建此图表?在 NEXTjs 和 TSX 中

条件渲染元素的测试不起作用

如何在 ChartJS 中操作 Y 轴

单元测试 useLoaderData() react-router v6 加载器函数

刷新页面时状态改变问题

渲染的钩子比预期的少.这可能是由 React Hooks 中意外的提前返回语句引起的

使用 React 中的功能组件更改另一个组件的状态

哪个是创建 React 应用程序的更好方法?

React useEffect hooks return () => cleanup() vs return cleanup

有没有办法只针对 React map 中的一个按钮?