How I can resolve this : Warning: Encountered two children with the same key, `%s`

Just do this in you flatlist

keyExtractor={(item, index) => String(index)}

I think that your some of contact.id's are same. So you can get this warning. If you set the index number of the list in FlatList, you can't show this.

keyExtractor={(contact, index) => String(index)}

Don't build keys using the index on the fly. If you want to build keys, you should do it BEFORE render if possible.

If your contacts have a guaranteed unique id, you should use that. If they do not, you should build a key before your data is in the view using a function that produces unique keys

Example code:

  // Math.random should be unique because of its seeding algorithm.
  // Convert it to base 36 (numbers + letters), and grab the first 9 characters
  // after the decimal.
  const keyGenerator = () => '_' + Math.random().toString(36).substr(2, 9)
  // in component
  key={contact.key}