Lindy W.
Oct 24, 2020

Cool stuff!

Another improvement suggestion to avoid doing a looping in handleCheckChieldElement(event),

I used to pass in 'index' as a second parameter, because array.map provide the index as well.

so, it will be:

handleCheckChieldElement = (event, index) => {

let fruites = this.state.fruites;

fruites[index] = { value: event.target.value, isChecked: event.target.checked};

this.setState({fruites: fruites})

}

Lindy W.
Lindy W.

Written by Lindy W.

Just a software development radom blogs, writing random tech related article.

No responses yet