score:5

Accepted answer
onChange={this.handleChange.bind(this)}

score:0

import React from 'react';

class Child extends React.Component {

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

  render(){
    return (
      <div>
        <select
          id="great-names"
          onChange={this.handleChange}>

          <option value="Frarthur">Frarthur</option>
          <option value="Gromulus">Gromulus</option>
          <option value="Thinkpiece">Thinkpiece</option>

        </select>
      </div>
    );
  }
}

export default Child;

score:0

addTask = (task) => {
    /* ... */
    this.setState({ task })
}

Related Query

More Query from same tag