React: Warnning:"Encountered two children with the same key"

Created on 23 Nov 2016  路  3Comments  路  Source: facebook/react

image

image

image

image

I am sure the key is unique ,so why also print the warning error.
My react version is 0.14.8

thank you

Most helpful comment

can u please tell me what was actual issue, i m having same warnings when i call onReachEnd method flatlist

All 3 comments

The full call stack of one like this below :

warning.js:45 Warning: flattenChildren(...): Encountered two children with the same key, .$outbox81. Child keys must be unique; when two children share a key, only the first child will be used.warning @ warning.js:45flattenSingleChildIntoContext @ flattenChildren.js:27traverseAllChildrenImpl @ traverseAllChildren.js:98traverseAllChildrenImpl @ traverseAllChildren.js:114traverseAllChildren @ traverseAllChildren.js:186flattenChildren @ flattenChildren.js:44_reconcilerUpdateChildren @ ReactMultiChild.js:212_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66performUpdateIfNecessary @ ReactCompositeComponent.js:421performUpdateIfNecessary @ ReactReconciler.js:102obj.(anonymous function) @ backend.js:8386runBatchedUpdates @ ReactUpdates.js:129perform @ Transaction.js:136perform @ Transaction.js:136perform @ ReactUpdates.js:86flushBatchedUpdates @ ReactUpdates.js:147ReactUpdates_flushBatchedUpdates @ ReactPerf.js:66closeAll @ Transaction.js:202perform @ Transaction.js:149batchedUpdates @ ReactDefaultBatchingStrategy.js:62enqueueUpdate @ ReactUpdates.js:176enqueueUpdate @ ReactUpdateQueue.js:24enqueueSetState @ ReactUpdateQueue.js:190ReactComponent.setState @ ReactComponent.js:65handleChange @ connect.js:301dispatch @ createStore.js:186(anonymous function) @ api.js:91(anonymous function) @ index.js:15(anonymous function) @ middleware.js:22(anonymous function) @ bindActionCreators.js:7hide @ index.js:743handleDocumentClick @ index.js:519
warning.js:45 Warning: flattenChildren(...): Encountered two children with the same key, .$outbox80. Child keys must be unique; when two children share a key, only the first child will be used.warning @ warning.js:45flattenSingleChildIntoContext @ flattenChildren.js:27traverseAllChildrenImpl @ traverseAllChildren.js:98traverseAllChildrenImpl @ traverseAllChildren.js:114traverseAllChildren @ traverseAllChildren.js:186flattenChildren @ flattenChildren.js:44_reconcilerUpdateChildren @ ReactMultiChild.js:212_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386updateChildren @ ReactChildReconciler.js:84_reconcilerUpdateChildren @ ReactMultiChild.js:216_updateChildren @ ReactMultiChild.js:351updateChildren @ ReactMultiChild.js:326_updateDOMChildren @ ReactDOMComponent.js:871updateComponent @ ReactDOMComponent.js:700receiveComponent @ ReactDOMComponent.js:645receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66receiveComponent @ ReactCompositeComponent.js:405receiveComponent @ ReactReconciler.js:87obj.(anonymous function) @ backend.js:8386_updateRenderedComponent @ ReactCompositeComponent.js:562_performComponentUpdate @ ReactCompositeComponent.js:544updateComponent @ ReactCompositeComponent.js:473ReactCompositeComponent_updateComponent @ ReactPerf.js:66performUpdateIfNecessary @ ReactCompositeComponent.js:421performUpdateIfNecessary @ ReactReconciler.js:102obj.(anonymous function) @ backend.js:8386runBatchedUpdates @ ReactUpdates.js:129perform @ Transaction.js:136perform @ Transaction.js:136perform @ ReactUpdates.js:86flushBatchedUpdates @ ReactUpdates.js:147ReactUpdates_flushBatchedUpdates @ ReactPerf.js:66closeAll @ Transaction.js:202perform @ Transaction.js:149batchedUpdates @ ReactDefaultBatchingStrategy.js:62enqueueUpdate @ ReactUpdates.js:176enqueueUpdate @ ReactUpdateQueue.js:24enqueueSetState @ ReactUpdateQueue.js:190ReactComponent.setState @ ReactComponent.js:65handleChange @ connect.js:301dispatch @ createStore.js:186(anonymous function) @ api.js:91(anonymous function) @ index.js:15(anonymous function) @ middleware.js:22(anonymous function) @ bindActionCreators.js:7hide @ index.js:743handleDocumentClick @ index.js:519

image

Sorry , It's my mistake.

can u please tell me what was actual issue, i m having same warnings when i call onReachEnd method flatlist

Was this page helpful?
0 / 5 - 0 ratings