react-native-app-intro-slider icon indicating copy to clipboard operation
react-native-app-intro-slider copied to clipboard

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

Open Lekhrajk opened this issue 4 years ago • 5 comments

I am getting this warning again and again How to remove this warning

Lekhrajk avatar Jan 11 '21 01:01 Lekhrajk

x2

barinascode avatar Feb 09 '21 17:02 barinascode

I am getting this warning again and again How to remove this warning

Found a solution. Just pass your own keyExtractor function to the <AppIntroSlider/> component and cast to string. FlatList requires a string key.

return (
    <AppIntroSlider
      keyExtractor={(item) => item.id.toString()}
      renderItem={_renderItem}
      data={steps}
      onDone={_onDone}
      renderNextButton={_renderNextButton}
      renderDoneButton={_renderDoneButton}
    />
  )

JoeToeniskoetter avatar Feb 15 '21 20:02 JoeToeniskoetter

This results in TypeError: undefined is not an object (evaluating 'item.id.toString')

Sanan4li avatar Aug 31 '21 09:08 Sanan4li

The following worked for me keyExtractor={(item, index) => index.toString()} just pass it to your AppIntroSlider Component

Sanan4li avatar Aug 31 '21 09:08 Sanan4li

I am getting this warning again and again How to remove this warning

Found a solution. Just pass your own keyExtractor function to the <AppIntroSlider/> component and cast to string. FlatList requires a string key.

return (
    <AppIntroSlider
      keyExtractor={(item) => item.id.toString()}
      renderItem={_renderItem}
      data={steps}
      onDone={_onDone}
      renderNextButton={_renderNextButton}
      renderDoneButton={_renderDoneButton}
    />
  )

work for me. keyExtractor={(item) => ${item.key}} or keyExtractor={(item) => ${item.id}} with key(id) from a element of data slide

phamhieu1412 avatar Jan 26 '22 04:01 phamhieu1412