Coding Challenge
Practice adding buttons to React and Python while using Transcrypt.
We'll cover the following
Problem statement
Currently, we have an application that can add, edit, and delete items in a list for us. We want to add an option to clear all of it. For this code challenge:
-
Add a button that will remove all items that exist in the list.
-
Reset the input box to be empty. This
Clear
button should be placed right next to the submit button. -
In addition to adding the button to the component tree, we will also need to add a
handleClear()
function for handling theonClick
event of the new button.
We’ll also need to add the line of code that prevents the event handler from performing its default action.
Get hands-on with 1400+ tech skills courses.