Reputation:
In the following code maps over a useState
called allTodos
. It uses this data to render multiple components:
let todoComponents = allTodos.map(item => <Todos key={item.id} item={item} handleChange={handleChange}/>)
The problem is that the .map
needs access the id
in an object within an object with a unique name.
How can I tell .map
to skip over the object, regardless of its name and get the id
(other any other values).
Upvotes: 1
Views: 724