I have a following code. This is the rest of the react class component that shall be rendered.
render() {
return (
<div>
{this.state.todos.map((todo) => (
<h1 id={todo.id} onClick={this.deleteTodo}> {todo.name} </h1>
))}
</div>
);
}
I would like to have assigned id={todo.id} as number and not as text. Don't you know please, how to fix it?
Right now, it is actually like this: id="1", but I would need that as id=1.
Thank you for your help