Create a form with multiple input fields that remembers the user’s data even after the browser is refreshed. The form should continuously save user input and provide an option to clear all saved data.
Things to do
- Create a form with Name, Email and Message input fields.
- User inputs should be saved automatically.
- On page reload, the form should restore previously saved values.
- Add a Clear button that resets all input fields and removes saved data.
- All inputs must be controlled by React state.
- Keep localstorage key name as 'autosave'
Testing Instructions
- Please use the following data-testid attributes in your React component:
form-input → for the text input
form-email → for the email input
form-message → for the textarea
clear-btn → for clear button