zendesk / zopim-chat-web-sdk-sample-app

Zendesk Chat Web SDK sample app developed using React
https://api.zopim.com/web-sdk
Other
98 stars 61 forks source link

unique “key” prop warning occurs when trigger message is sent #15

Closed ynarish closed 6 years ago

ynarish commented 7 years ago

I'm getting warning:

Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of MessageList. See https://fb.me/react-warning-keys for more information. in div (created by MessageList) in MessageList (created by App) in div (created by App) in div (created by App) in App (created by Connect(App)) in Connect(App) in Provider

It occurs when trigger message is sent. Then I refresh the page, no warning is displayed. I suppose it occurs when 'typing' event and 'chat.memberjoin' event occured sequentially.

ramirogm commented 7 years ago

That's probably because it's using a timestamp as the key. You can use any unique identifier to avoid this error

ynarish commented 6 years ago

OK. I'll try it. thanks.

junyi commented 6 years ago

Hi @ynarish, apologies for the late reply, this should be fixed in the latest master already.