Below is the code:
const clear=() =>{ setCurrentId(0); setPostData({creator: '',title: '', message: '', tags:'',selectedFile:'' }); }
Output: It should clear the entered details
I am expecting the output to be cleared but the button doesn’t works nor does it shows any error, why is the clear button not working?
New contributor
Geetanjali Sultane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.