meliorence / react-native-image-gallery

Pure JavaScript image gallery component for iOS and Android with high-performance and native feeling in mind
715 stars 298 forks source link

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

Closed rodrigofbm closed 6 years ago

rodrigofbm commented 6 years ago
Warning: Failed child context type: Invalid child context `virtualizedCell.cellKey` of type `number` supplied to `CellRenderer`, expected `string`.
    in CellRenderer (at VirtualizedList.js:670)
    in AndroidHorizontalScrollContentView (at ScrollView.js:791)
    in AndroidHorizontalScrollView (at ScrollView.js:887)
    in ScrollView (at VirtualizedList.js:1024)
    in VirtualizedList (at FlatList.js:644)
    in FlatList (at index.js:318)
    in RCTView (at View.js:60)
    in View (at index.js:314)
    in ViewPager (at Gallery.js:275)
    in Gallery (at PetImageGallery.js:32)
    in RCTView (at View.js:60)
    in View (at PetImageGallery.js:31)
    in RCTView (at View.js:60)
    in View (at createAnimatedComponent.js:154)
    in AnimatedComponent (at index.js:153)
    in RCTView (at View.js:60)
    in View (at index.js:247)
    in SideMenu (at PetImageGallery.js:26)
    in PetImageGallery (created by Connect(PetImageGallery))
    in Connect(PetImageGallery) (at navigationStore.js:319)
    in Wrapped (at SceneView.js:31)
    in SceneView (at CardStack.js:412)
    in RCTView (at View.js:60)
    in View (at CardStack.js:411)
    in RCTView (at View.js:60)
    in View (at CardStack.js:410)
    in RCTView (at View.js:60)
    in View (at createAnimatedComponent.js:154)
    in AnimatedComponent (at Card.js:26)
    in Card (at PointerEventsContainer.js:55)
    in Container (at CardStack.js:454)
    in RCTView (at View.js:60)
    in View (at CardStack.js:383)
    in RCTView (at View.js:60)
    in View (at CardStack.js:382)
    in CardStack (at CardStackTransitioner.js:97)
    in RCTView (at View.js:60)
    in View (at Transitioner.js:192)
    in Transitioner (at CardStackTransitioner.js:49)
    in CardStackTransitioner (at StackNavigator.js:60)
    in Unknown (at createNavigator.js:52)
    in Navigator (at createNavigationContainer.js:210)
    in NavigationContainer (at Router.js:70)
    in App (at Router.js:91)
    in Router (at App.js:42)
    in Provider (at App.js:41)
    in App (at renderApplication.js:33)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:122)
    in AppContainer (at renderApplication.js:32)
83c02a32-cab4-4d08-929a-42f0d4ec5b4d:15193:5

I've got this warning. Someone know hot to fix it?

Environment

OS: Linux 4.13 Node: 9.10.1 Yarn: 1.6.0 npm: 5.6.0 Watchman: Not Found Xcode: N/A Android Studio: Not Found

Packages: (wanted => installed) react: 16.3.1 => 16.3.1 react-native: 0.55.3 => 0.55.3

rodrigofbm commented 6 years ago

Solved changing to keyExtractor={(item, index) => index.toString()} in _nodemodules/react-native-image-gallery/src/libraries/ViewPager/index.js

JanithaR commented 6 years ago

Is this the real issue here? If this a problem with the module then shouldn't that be fixed via a PR?

robreuss commented 6 years ago

Seeing this issue also.

andy-asi commented 3 years ago

you can use: https://github.com/archriss/react-native-image-gallery/pull/152