q3e / react-native-github-graphql-app

React Native App that searches github projects and their contributors[WIP]
MIT License
2 stars 0 forks source link

VirtualizedList: missing keys for items, make sure to specify a key property on each item or provide a custom keyExtractor. #14

Closed q3e closed 7 years ago

q3e commented 7 years ago

All mapped lists items require a unique key in react, hence this WARNING on our contributorList screen: img_20171105_185120

q3e commented 7 years ago

Fixed by https://github.com/bnovf/react-native-github-graphql-app/commit/524905f3236ab1d2c5beb3c5ce69146ea445d5a2 Add a keyExtractor prop to flat list item like here https://stackoverflow.com/questions/44545148/basic-flatlist-code-throws-warning-react-native

NarendraSingh88 commented 6 years ago

@fatahn adding a keyExtractor is giving me another warning. what I have added is - keyExtractor={(item, index) => index}

Failed child context type: Invalid child context 'virtualizedCell.cellKey' of type 'number' supplied to 'CellRenderer', expected 'string'.

screenshot_20180602-133734

anniewey commented 6 years ago

@NarendraSingh88 use keyExtractor={(item, index) => index.toString()}

Bharavi26 commented 5 years ago

i already added this line ...keyExtractor={(item, index) => index.toString()} ...but this warning also show.. any suggestion..?

nadirHomeFriend commented 5 years ago

hello, iam having a very stage issue, i have a Panel component that is put to it my FlatList . when applying border to the Panel Style FlatList desappear . not that it is working fine with 3 items , when the list of items si big iam not able to see the flastList . it looks like the Items List is transparent because when i click on it iam navigating to the right item page. thanks for your reply