react-webpack-rails-tutorial icon indicating copy to clipboard operation
react-webpack-rails-tutorial copied to clipboard

flattenChildren warning in JS console when adding second comment

Open reconstructions opened this issue 7 years ago • 2 comments

When adding a second comment (without reloading) using the new ActionCable enabled version of react-webpack-rails-tutorial, I get the following error (twice) in my browser console. The comment is added and appears correctly in the view, but apparently the keys aren't unique, probably the count isn't incremented properly now that ActionCable has replaced REST. Here's the error trace:

Warning: flattenChildren(...): Encountered two children with the same key, `67`. Child keys must be unique; when two children share a key, only the first child will be used.
    in ReactTransitionGroup (created by ReactCSSTransitionGroup)
    in ReactCSSTransitionGroup (created by CommentList)
    in div (created by CommentList)
    in CommentList (created by CommentBox)
    in div (created by CommentBox)
    in CommentBox (created by InjectIntl(CommentBox))
    in InjectIntl(CommentBox) (created by CommentScreen)
    in div (created by CommentScreen)
    in div (created by CommentScreen)
    in CommentScreen (created by RouterCommentsContainer)
    in IntlProvider (created by RouterCommentsContainer)
    in RouterCommentsContainer (created by Connect(RouterCommentsContainer))
    in Connect(RouterCommentsContainer) (created by RouterContext)
    in section (created by Layout)
    in Layout (created by RouterContext)
    in RouterContext (created by Router)
    in Router
    in Provider

reconstructions avatar Mar 29 '17 02:03 reconstructions

@reconstructions Any chance that you want to try to submit a PR to address this?

justin808 avatar Mar 31 '17 01:03 justin808

@justin808 I will see if I can try and track it down in the next couple days, thx.

reconstructions avatar Mar 31 '17 05:03 reconstructions

It seems this issue is resolved.

ahangarha avatar Aug 02 '23 18:08 ahangarha