2017-08-11 30 views
0

在进行一些重构后,在reactjs组件中得到此错误。找不到任何直接的信息。请参阅下面的代码,导致问题和修复。无法读取未定义的属性'idCounter'hostcontainerinfo

这是一个完整的异常:

Uncaught TypeError: Cannot read property '_idCounter' of undefined 
at ReactDOMTextComponent.mountComponent (ReactDOMTextComponent.js:78) 
at Object.mountComponent (ReactReconciler.js:45) 
at ReactKonvaComponent.mountChildren (ReactMultiChild.js:236) 
at ReactKonvaComponent.mountAndInjectChildren (react-konva.js:97) 
at ReactKonvaComponent.mountComponent (react-konva.js:311) 
at Object.mountComponent (ReactReconciler.js:45) 
at Object.mountChildren (ReactMultiChild.js:236) 
at Object.mountAndInjectChildren (react-konva.js:97) 
at ReactReconcileTransaction.perform (Transaction.js:143) 
at Object.componentDidMount (react-konva.js:248) 
at Object.chainedFunction [as componentDidMount] (factory.js:617) 
at ReactCompositeComponent.js:264 
at measureLifeCyclePerf (ReactCompositeComponent.js:75) 
at ReactCompositeComponent.js:263 
at CallbackQueue.notifyAll (CallbackQueue.js:76) 
at ReactReconcileTransaction.close (ReactReconcileTransaction.js:80) 
at ReactReconcileTransaction.closeAll (Transaction.js:209) 
at ReactReconcileTransaction.perform (Transaction.js:156) 
at batchedMountComponentIntoNode (ReactMount.js:126) 
at ReactDefaultBatchingStrategyTransaction.perform (Transaction.js:143) 
at Object.batchedUpdates (ReactDefaultBatchingStrategy.js:62) 
at Object.batchedUpdates (ReactUpdates.js:97) 
at Object._renderNewRootComponent (ReactMount.js:319) 
at Object._renderSubtreeIntoContainer (ReactMount.js:401) 
at Object.render (ReactMount.js:422) 
at Object../src/index.js (index.js:16) 
at __webpack_require__ (bootstrap 7268e22d223498460ebe:659) 
at fn (bootstrap 7268e22d223498460ebe:85) 
at Object.2 (konva jsdom:1) 
at __webpack_require__ (bootstrap 7268e22d223498460ebe:659) 
at ./node_modules/ansi-regex/index.js.module.exports (bootstrap 7268e22d223498460ebe:708) 
at bundle.js:712 

回答

0

的问题是,我有同样的元素上的两个标签倒闭。错误的复制和粘贴。

<Drawing scale={scale} 
     x={this.state.x} 
     y={this.state.y} 
     w={this.state.w}/> <=== Needed to remove extra /> 
     h={this.state.h}/> 
相关问题