Answer the question
In order to leave comments, you need to log in
When I render a list in the render method of React.JS, and I want to display only 'name' for example, I can't display the id. +name, what is the reason for this?
The code I wrote here: https://stackblitz.com/edit/react-7bygb1?file=index.js .
I use Immutable.js, I pass the id of the object I want to delete to the method, I display the rest of the elements using the map method.
Answer the question
In order to leave comments, you need to log in
You need to convert the OrderedMap to an array before calling map . To do this, you can use the toArray method :
return arr.delete(id).toArray().map(item => <li key={item.id}>{item.name}</li>);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question