G
G
GreenMan18992018-08-21 06:52:39
JavaScript
GreenMan1899, 2018-08-21 06:52:39

Why doesn't the script for TODO work?

https://codepen.io/danilst/pen/gdOjLm
When a new todo is added, the entire list of ever added todos is displayed again.
This was not before I decided to make a list on the components.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Proskurin, 2018-08-21
@GreenMan1899

Because you change the props, and in the loop in the parent, each time you pass this prop again. Make an onDelete event for the child, and catch it from the parent.
https://codepen.io/anon/pen/bxGmMB

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question