Auto Save Form
React.js
medium
25 mins
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
Preview what you need to build
Companies:
amazon
tcs
meesho
Solve Similar questions 🔥
Want to upskill? Explore our courses!
Namaste DSA
Master DSA from scratch with numerous problems, and expert guidance.
Namaste React
Wanna dive deep into React and become Frontend Expert? Learn with me now!
Namaste Frontend System Design
The most comprehensive and detailed course for frontend system design.
Namaste Node.js
Wanna dive deep into Node.js? Enroll into `Namaste Node.js` now!
