import React, { Component } from 'react'; class Answer extends Component { constructor(){ super(); // Binding handleChange to 'this' this.handleChange = this.handleChange.bind(this); } handleChange(e) { // Using the passed method setAnswer to set the answer. this.props.setAnswer(e.target.value, this.props.question); } render() { return (
  • ); } } export default Answer;