react-native-gifted-chat icon indicating copy to clipboard operation
react-native-gifted-chat copied to clipboard

Getting error: Encountered two children with the same key

Open bilal1031 opened this issue 1 year ago • 4 comments

Issue Description

Getting errors on messages render

Warning: Encountered two children with the same key, .$g9AHqhABMZZEVgjZx6CKbU3XKkj2. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.

Steps to Reproduce / Code Snippets

I am getting this error on a project using Expo SDK 51

  • Nodejs version: 20
  • React version: 18.2.0
  • React Native version: 0.74.1
  • react-native-gifted-chat version: ^2.4.0
  • Platform(s) (iOS, Android, or both?): both
  • TypeScript version: 5.3.3

bilal1031 avatar May 16 '24 13:05 bilal1031

this issue mean your dataset has duplicate item

fukemy avatar May 17 '24 03:05 fukemy

@fukemy @bilal1031 how can this be solved, I am also facing similar error

ayobamiseun avatar Feb 03 '25 10:02 ayobamiseun

@fukemy @bilal1031 how can this be solved, I am also facing similar error

check your code, I am sure you have duplicate data with same id

fukemy avatar Feb 04 '25 03:02 fukemy

I've noticed this issue as well, particularly using Expo when I hot-reload by saving the component after making a change. Something to do with a re-render there possibly?

flancast90 avatar Feb 08 '25 19:02 flancast90