Exercise: Forms

Requirements:

  1. As a user I can add new todo with text and category
  2. As a user I cannot add a todo without category or text
  3. As a user I see error messages when trying to insert invalid todo

Make sure that all tests pass and your result behaves as the following:

Slides

Let's practice forms and handlers in React!


This time, you will implement the whole experience of adding a todo with text and category, ensuring that all the required data is specified. Check out the animation. If the user does not specify a text or category, you shall not add a new todo and display an error message. If the form is validated, you add the todo and ensure the rest of the functionality works as expected!