Receive the Event Handler CHILD COMPONENTS UPDATE THEIR PARENTS' STATE

https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-react-part-ii/modules/fecp-stateless-components-from-stateful-components/lessons/child-updates-parents-state/exercises/child-parent-receive-handler

How is the value of the “e.target.value” generated? Is it similar to DOM event properties?

 handleChange(e) {
  const name = e.target.value;
  this.props.onChange(name);
}

Hello!

e is a SyntheticEvent (https://reactjs.org/docs/events.html) created by ReactJS. It is mostly compatible with browser event. See also https://reactjs.org/docs/handling-events.html.

1 Like