Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty item is inserted in the UI #8

Closed
amos-kibet opened this issue Sep 1, 2020 · 3 comments
Closed

Empty item is inserted in the UI #8

amos-kibet opened this issue Sep 1, 2020 · 3 comments

Comments

@amos-kibet
Copy link

Hi, I have been following the to-do tutorial and I realized when you click the Add button without typing anything to the input field, it is rendered as a to-do item in the UI, only that it is empty(does not have a name).

@chrisdavidmills
Copy link
Collaborator

Hi @amos-kibet ! This is a good point — we've not added any kind of check into the code to disallow empty tasks from being added. I've added a note at the bottom of https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks/React_interactivity_events_state#Updating_state to signal this, and ask readers to try to create their own solution.

It's pretty easy to do, therefore its a nice little exercise to let you try. Give me a ping if you run into troubles with it.

@amos-kibet
Copy link
Author

amos-kibet commented Sep 2, 2020 via email

@chrisdavidmills
Copy link
Collaborator

Right on! I am glad you are finding it helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants