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 trialJonathan Kuhl
26,133 PointscurrentTarget.reset()?
I don't know if this is covered, but where does this line even come from?
event.currentTarget.reset();
I'm not sure where currentTarget.reset()
is being defined. Is it a part of the React library?
1 Answer
Missy Kailet
4,475 PointsI'm not sure where currentTarget.reset() is being defined. Is it a part of the React library?
As Kjetil-Lennart l pointed out, that method comes from the Event API available in JavaScript. If you recall from the lecture, Guil mentioned that refs allow for "more traditional DOM manipulation" with vanilla JavaScript.
Andrii Kodola
Full Stack JavaScript Techdegree Student 16,870 PointsAnd here is a short reset() method description, just to know where it comes from - https://www.w3schools.com/jsref/met_form_reset.asp.
Kjetil-Lennart A. Lorentzen
13,390 PointsKjetil-Lennart A. Lorentzen
13,390 Pointshttps://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget