Reset state back to initial values.
Section: State Hooks
Reset component state
tsx
tsx
const initialForm = { email: '', password: '' };
const [form, setForm] = useState(initialForm);
const resetForm = () => setForm(initialForm);Explanation
Useful for form reset behavior after submit or cancel.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing State Hooks