Where does newName come from?

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/react-102/lessons/child-updates-sibling/exercises/stateless-inherit-stateful-recap?action=lesson_resume

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
I’m at the end of this lesson and my code works, but I don’t understand it. I understand that Parent inherits Child and Siblings’ props to update it’s state, but usually this is passed through a variable called “name”. “name” is collected through the element’s onChange attribute, where the event is captured from the 's value attribute. From there, it’s passed into changeName, and there’s the newName argument, but it’s never referenced anywhere else. Does React understand “new” as a prefix or am I not understanding something? I know arguments can be named anything, but usually they’re named to relate to a global variable like “name” is.

Why does newName work?

```

var Parent = React.createClass({
// getInitialState function
changeName: function (newName) {
this.setState({
name: newName
});
//render function

<do not remove the three backticks above>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.