簡體   English   中英

無需調試即可啟動React Native錯誤

[英]React Native error when start without debug

在命令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

libs的版本

“react-dom”:“~15.3.2”,“react-native”:“^ 0.39.2”,

在我使用React Native的情況下,我們將這個神秘的bug拖了幾周才出現在Android版本中而沒有附加的調試器,正如你所描述的那樣

罪魁禍首

import 'core-js'

在我們的根組件上,似乎polyfill搞砸了

只需刪除導入行並嘗試一下即可

package.json相關部分

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM