question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: Failed child... type number, expected string (ActionSheet)

See original GitHub issue

react-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)

captura de pantalla 2018-02-06 a la s 11 31 50

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:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
SupriyaKalghatgicommented, Mar 9, 2018

Fixed with NB 2.3.10

4reactions
akhil-gacommented, Feb 21, 2018

@flindenberg @CristiTr this will be fixed in upcoming release

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found