Or for forms, if you're just submitting the values and not displaying them anywhere else, you can use uncontrolled inputs! :D
functionMyComponent(){consthandleSubmit=useCallback((evt)=>{evt.preventDefault()console.log(evt.target.elements.data1.value)// etc...// submit your data...},[])return<formonSubmit="handleSubmit"><inputname="data1"/><inputname="data2"/><inputname="data3"/><buttontype="submit">submit</button></form>}
Oh yes, definitely agree with the example and the point you're making! I just felt like throwing it out there as an extra gimmick, because a lot of people don't realize sometimes you don't need to use any state at all!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Or for forms, if you're just submitting the values and not displaying them anywhere else, you can use uncontrolled inputs! :D
Yes, but I needed an example and forms are the easiest one. =p
Oh yes, definitely agree with the example and the point you're making! I just felt like throwing it out there as an extra gimmick, because a lot of people don't realize sometimes you don't need to use any state at all!