Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

e.target.value on an input field ReactJs, how does it work?

https://facebook.github.io/react/docs/thinking-in-react.html

I'm at the end of this tutorial and I'm just not understanding how e.target.value works. Walk through the end of this tutorial and see the sample code that there is please. I'm newbie both to React and Javascript.

like image 567
Diogo Matias Avatar asked Aug 10 '17 23:08

Diogo Matias


1 Answers

When you need to handle multiple controlled input elements, you can add a name attribute to each element and let the handler function choose what to do based on the value of event.target.name. By React DOC

like image 51
Tausif Shekh Avatar answered Oct 22 '22 06:10

Tausif Shekh