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

Allow iterables, not just arrays, as child elements #389

Open
blzaugg opened this issue Aug 3, 2018 · 0 comments
Open

Allow iterables, not just arrays, as child elements #389

blzaugg opened this issue Aug 3, 2018 · 0 comments

Comments

@blzaugg
Copy link
Contributor

blzaugg commented Aug 3, 2018

This would allow mapping over any iterable (like Immutable.js) object, rather than having to convert those objects to arrays.

Code before:

{myList.map(
    // ...
).toArray()}

Code after:

{myList.map(
    // ...
)}

Pro:

  • Faster code, as you don't have the overhead of converting to array.
  • Less implementation code.

React added this feature in v0.13.0:
facebook/react@c07ea0b

From Lee Byron (no relation) on avoiding conversion:
https://twitter.com/leeb/status/746733697093668864?lang=en

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

1 participant