Warning: Failed child... type number, expected string (ActionSheet)
See original GitHub issuereact-native, react and native-base version
react-native 0.53 react 16.2.0 native-base 2.3.8
Expected behaviour
Work just fine without warnings (on Debug)
Actual behaviour
When activating the ActionSheet, the warning its displayed.
Steps to reproduce (code snippet or screenshot)
Screenshot of emulator/device
Is the bug present in both ios and android or in any one of them?
both platforms. iOS AND android
Any other additional info which would help us debug the issue quicker.
On the ActionSheet.js file, the keyExtractor returns the index, but it should return it converted to string
<FlatList
style={{ marginHorizontal: -15, marginTop: 15 }}
data={this.state.items}
keyExtractor={(item, index) => index}
should look:
<FlatList
style={{ marginHorizontal: -15, marginTop: 15 }}
data={this.state.items}
keyExtractor={(item, index) => String(index) }
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Invalid child context 'virtualizedCell.cellKey' of type 'number ...
To fix the error in any list components where a keyExtractor is in use, update the Component (FlatList etc) to have a string...
Read more >Invalid child context 'virtualizedCell.cellKey' of type 'number ...
cellKey' of type 'number' supplied to 'CellRenderer', expected 'string'. React Native Flat List or ActionSheet requires id to be string-type.
Read more >Invalid child context `virtualizedCell.cellKey` of type `number`
This is how you can solve the warning: Failed child context type: Invalid child context virtualizedCell.cellKey of type number supplied to CellRenderer, ...
Read more >Invalid child context 'virtualizedCell.cellKey' of type 'number ...
[Solved]-Warning : Failed child context type: Invalid child context 'virtualizedCell.cellKey' of type 'number' supplied to 'CellRenderer', expected 'string'- ...
Read more >Invalid child context 'virtualizedCell.cellKey' of type 'number ...
Ios – Warning : Failed child context type: Invalid child context 'virtualizedCell.cellKey' of type 'number' supplied to 'CellRenderer', expected 'string'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed with NB 2.3.10
@flindenberg @CristiTr this will be fixed in upcoming release