Immutable.KeyedIterable as children
See original GitHub issueI’m aware of the Iterable support for children, but is there any timetable for supporting KeyedIterable from Immutable.js, specifically for automatically providing keys to children?
Sample use case:
var myItems = Immutable.Map({ // extends KeyedIterable
one: 111,
two: 222
});
var renderedItems = (
<ul>{myItems.map(item => (
<li>{item}</li>
))}</ul>
);
That is, the first item would end up the equivalent of <li key="one">111</li>
.
If such support isn’t on the roadmap, can I somehow avoid having to use React.cloneElement()
(which will have performance implications) if I write a helper function that does this?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:16 (3 by maintainers)
Top Results From Across the Web
Collection.Keyed - Immutable.js
Returns a Seq.Keyed from this Iterable where indices are treated as keys. toKeyedSeq(): Seq.Keyed<K, V> ...
Read more >What is the "correct" react way to update the state from a child ...
I want an user interaction on the child to update the state. Example of state: ... Will Immutable.js's KeyedIterable be the one to...
Read more >Immutable JS - converting a collection of Maps to a List
the object is converted to immutable JS via fromJS(). I need a new object in the following structure: data :[{name: 'john', surname ...
Read more >swagger-ui-dist - UNPKG
node_modules/immutable/dist/immutable.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js" ...
Read more >https://fossies.org/linux/hhvm/hphp/hack/hhi/inter...
public function toValuesArray(): varray<Tv>; /** * Returns an immutable vector ... @return An `Iterable` with the values of the current `KeyedIterable`.
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 Free
Top 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
Same here. Any news on why React iterates both valueSeq() and entrySeq() twice? This still happens to me with React 15.4.2.
Using Immutable.Map.map() directly and ignoring the error “Using Maps as children is not yet fully supported” works fine though, which is weird.
This happens to me too. React iterates
entrySeq()
twice. This is the first thread I found so far that mentioned this issue.Just wondering, do you guys keep using
entrySeq()
that iterates twice? or using.toArray()
first or.map()
directly to iterate once?