Great work! You just wrote your first React form.
Notice that you didn’t use a submit button. You didn’t even use a <form>
element! Your “form” was actually just an <input />
.
That won’t always be the case. You will still sometimes want a <form>
element and a submit button, especially if you need to differentiate between a finished form and an in-progress form. But in some cases, it’s fine to have a “form” that is really just an input field.
This is because, unlike in the traditional form paradigm, in React you re-send your form on every single character change. That removes the need to ever “submit” anything.
That marks the end of this lesson! You’ve learned a wide variety of important techniques: inline styles, separating container and presentational components, stateless functional components, proptypes, and forms. These techniques will be invaluable as you continue to build out more React apps!