Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Lekhrajk opened this issue Jan 11, 2021 · 5 comments

Comments

@Lekhrajk
Copy link

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

@barinascode
Copy link

x2

@JoeToeniskoetter
Copy link

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}
    />
  )

@Sanan4li
Copy link

Sanan4li commented Aug 31, 2021

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

@Sanan4li
Copy link

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

@phamhieu1412
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants