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

Iterable.length warnings with ImmutableVirtualizedList #26

Closed
loiclouvet opened this issue Jun 27, 2017 · 3 comments
Closed

Iterable.length warnings with ImmutableVirtualizedList #26

loiclouvet opened this issue Jun 27, 2017 · 3 comments
Labels

Comments

@loiclouvet
Copy link
Contributor

Hello there !

I'm getting following warnings when using ImmutableVirtualizedList

YellowBox.js:71 iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. Error
    at Object.getItemCount (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:96434:37)
    at VirtualizedList.render (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:40071:34)

It seems to be linked to this line:
getItemCount={(items) => (items.size || items.length || 0)}

Should we remove items.length removed as warning says ?

Stack:
immutable: ^3.8.1
react-native-immutable-list-view: ^0.5.0

@cooperka
Copy link
Owner

Hi @loiclouvet, this is caused when items.size is 0 so it mistakenly falls back to trying to get items.length. Silly oversight on my part, it was just meant as a backup to allow Immutable data containing mutable data.

In the next release, I'm going to disallow this type of mixed data and this will no longer be an issue; I'll remove items.length. Thanks for the report!

@cooperka cooperka added the bug label Jun 30, 2017
@loiclouvet
Copy link
Contributor Author

loiclouvet commented Jul 3, 2017

@cooperka Thanks ! Will upgrade react-native-immutable-list-view as soon as you publish 0.5.1 on npm ! 😄

@cooperka
Copy link
Owner

cooperka commented Jul 3, 2017

Ah, too busy updating the tag I forgot to publish there. It's published now 🍻

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

No branches or pull requests

2 participants