Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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
.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)