Reputation: 127
I'm new to react and from what I've been reading it's not advised to use .toJS() from as it will affect performance.
But I'm using a third party component that requires an array as props but my state is set as an immutable list.
In this particular case should I use .toJS on my immutable list or do there is another way that wouldn't affect performance ?
Thanks
Upvotes: 2
Views: 1345
Reputation: 1066
Immutable collections have toArray
method, which will convert any Immutable structure to array. Keep in mind, this operation converts to array only shallowly.
Upvotes: 1