Code Challenge: React Controlled Input
State management is a method of controlling communication between different parts of state and their usage, including React components.
The goal of this challenge is to test your knowledge on state management by completing the task items:
- Implement a controlled input component, the input fields have been provided already.
- Implement a submit functionality on the form, so that when the submit button is clicked, the values of the controlled input component are added to the table below.
- The input fields should be cleared immediately the form is submitted.
We have provided some template code in the sandbox below that will help you get started. Implement your solution in the sandbox below:
Code challenge solution
Verify your solution with the official solution in this sandbox.
We have made available these extra resources to improve your React coding skills:
Want to conduct interviews on this platform?
Check out CoderPad: pick any interview question or create your own, then invite your candidate to a shared live-coding session on an IDE like this one. You even get 2 free interviews per month forever using this registration link!