Обнаружены двое детей с одним и тем же ключом (реактивный-родной, js) - PullRequest
0 голосов
/ 13 февраля 2020

Я столкнулся с этой проблемой Encountered two children with the same key, `11`. 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.

Проблема в том, что я проверил свой fetch, где я получаю массив для FlatList, и у меня нет элементов с id=11, а таких id вообще нет.

Вот мой FlatList компонент:

<FlatList
         horizontal
         showsHorizontalScrollIndicator={false}
         style={styles.myPatientsList}
         data={clients}
         renderItem={({ item }) => (
           <MyPatientsCard {...item} goToScreen={this.goToScreen} />
          )}
         keyExtractor={item => item.id.toString()}
         ListEmptyComponent={
            <Text style={styles.noClientsText}>
              {I18n.t('expertScreen.noPatients')}
            </Text>
           }
/>
...