Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

clear form in react

//with the useref hook you can do it easily
const form = useRef(null);

const handlesubmit = () => {
  form.current.reset(); //this will reset all the inputs in the form
}
<form ref={form} onSubmit={handlesubmit}></form>
Comment

PREVIOUS NEXT
Code Example
Javascript :: discord.js mention 
Javascript :: javascript substtgin 
Javascript :: exit forEach when null javascript 
Javascript :: add key to object only when there is value 
Javascript :: lity popup 
Javascript :: javascript ligten a color 
Javascript :: javascript reassignment 
Javascript :: must line ending of word regex match 
Javascript :: how to resolve click for div logging as parent too, in react 
Javascript :: usehistory forceRefresh 
Javascript :: how to get selected option attribute value in jquery 
Javascript :: localstorage API JS get Item 
Javascript :: Using Scrip as Web app 
Javascript :: ternary operator online 
Javascript :: getting form value(s) with js 
Javascript :: js cannot use import statement outside a module 
Javascript :: This is an example of oligosaccharides: 
Javascript :: socket mock 
Javascript :: fetch file on server using jquery 
Javascript :: go over each line in text nodejs 
Javascript :: how to define an object in javascript 
Javascript :: how to add some thing in JS Array 
Javascript :: Chrome Extension get Selection 
Javascript :: Event listener with single mouse click in extendscript 
Javascript :: react export multiple component from index.js 
Javascript :: odata filter query error Property access can only be applied to a single value. 
Javascript :: get ordinal number 
Javascript :: js array find first match 
Javascript :: reinitialise or reset all values in mapping in solidity 
Javascript :: bootstrapmaterialdatepicker get selected value on changes 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =