React useReducer hook does not let me change input values of user information form

First time asking. Thanks in advance, hope I explain my problem properly. A few weeks ago I started working with MERN stack and my problem appeared while trying to build a form where users could see/update their personal info. To achieve this, I implemented a useEffect hook that gets the current userĀ“s personal info through… Read More React useReducer hook does not let me change input values of user information form

React: Receive object data from Form Input and add list in an array

I store the input data in an object and send it to parent comp App.js, I want to create a list every time the user submits the form containing that object data in an array and the list keeps adding data. AddUserForm.js export default function AddUserForm({addedUser}) { const [name, setName] = useState(”); const [email, setEmail]… Read More React: Receive object data from Form Input and add list in an array

How can i reset react form all input field?

I used React Hooks Form library for my project. But I can’t able to reset after submitting data. Below, I have added my code. const AddItem = () => { const { register, handleSubmit } = useForm(); const onSubmit = (data) =>{ const url = `http://localhost:5000/products`; fetch(url,{ method: ‘POST’, headers: { ‘content-type’: ‘application/json’ }, body:… Read More How can i reset react form all input field?