I have problem with removeItem function (it should remove current that button is nested in, and item from array on this.state.list), no code currentl
I think you should pass the index of the item to your removeItem
function. Like so:
removeItem(index) {
const list = this.state.list;
list.splice(index, 1);
this.setState({ list });
}
render() {
return(
My Todo List
Add item
this.textChange(e)}/>
{
this.state.list.map((text, i) => {
return (
-
{text}
);
})}
)
}