gpt4 book ai didi

react-native - 在没有调试的情况下启动时 react native 错误

转载 作者:行者123 更新时间:2023-12-04 21:07:25 26 4
gpt4 key购买 nike

在通过命令 react-native run-android 启动应用程序后,我遇到了一个错误.关闭远程调试时出现错误。使用调试器一切正常。

Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner, _store}). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of `View`.
traverseAllChildrenImpl
traverseAllChildren.js:183
traverseAllChildrenImpl
traverseAllChildren.js:102
traverseAllChildren
traverseAllChildren.js:218
instantiateChildren
ReactChildReconciler.js:86
_reconcilerInstantiateChildren
ReactMultiChild.js:179
mountChildren
ReactMultiChild.js:249
initializeChildren
ReactNativeBaseComponent.js:74
mountComponent
ReactNativeBaseComponent.js:211
mountComponent
ReactReconciler.js:61
performInitialMount
ReactCompositeComponent.js:495
mountComponent
ReactCompositeComponent.js:346
mountComponent
ReactReconciler.js:61
performInitialMount
ReactCompositeComponent.js:495
mountComponent
ReactCompositeComponent.js:346
mountComponent
ReactReconciler.js:61
performInitialMount
ReactCompositeComponent.js:495
mountComponent
ReactCompositeComponent.js:346
mountComponent
ReactReconciler.js:61
mountComponentIntoNode
ReactNativeMount.js:54
perform
Transaction.js:149
batchedMountComponentIntoNode
ReactNativeMount.js:77
perform
Transaction.js:149
batchedUpdates
ReactDefaultBatchingStrategy.js:65
batchedUpdates
ReactUpdates.js:111
renderComponent
ReactNativeMount.js:141
render
ReactNative.js:31
renderApplication
renderApplication.js:33
run
AppRegistry.js:76
runApplication
AppRegistry.js:105
__callFunction
MessageQueue.js:236
<unknown>
MessageQueue.js:108
guard
MessageQueue.js:46
callFunctionReturnFlushedQueue
MessageQueue.js:107

库的版本

"react-dom": "~15.3.2",
"react-native": "^0.39.2",

最佳答案

在我使用 React Native 的情况下,我们将这个神秘的错误拖了数周,只出现在没有附加调试器的 Android 版本中,如您所描述的

罪魁祸首曾是一个
import 'core-js'
在我们的根组件上,似乎 polyfill 把事情搞砸了

只需删除导入行并尝试一下
package.json的相关部分

  "react-native": "0.44.2",
"react": "16.0.0-alpha.6",

关于react-native - 在没有调试的情况下启动时 react native 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42360372/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com