Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript React Components (2018) Managing State and Data Flow Controlled Components

Dom Ss
Dom Ss
4,339 Points

e.target.value Could you elaborate on that target method?

We were using e.target.value.

Is target React Specific ?

2 Answers

Myles Young
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Myles Young
Full Stack JavaScript Techdegree Graduate 22,056 Points

yeah so if you go & console.log(e) in your function this is using an event (let's say a input field) you could go into your browser, open the console, and see the event is a object with properties. you can see the event obj having the property target, which also has properties. so if you dig a little deeper into target, you'll see that there is another prop called value, and that is the text you provided to that input element by logging (e.target.value)

not a method, but a property.

I'm assuming 'e' refers to an event here, where target is the 'target' of the event (for example in a click event, it's the object being clicked that is the target)