React: Pass a Callback as Props Not clear on the guidelines

React: Pass a Callback as Props Not clear on the guidelines
0

#1

My code is close it only fails one test but the message seems to be exactly what I thought I wrote
I guess I’m not seeing the forest for the trees
Many thanks for any help on this

https://learn.freecodecamp.org/front-end-libraries/react/pass-a-callback-as-props

Not passing: The GetInput component should receive the MyApp state property inputValue as props and contain an input element which modifies MyApp state.

class MyApp extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      inputValue: ''
    }
    this.handleChange = this.handleChange.bind(this);
  }
  handleChange(event) {
    this.setState({
      inputValue: event.target.value
    });
  }
  render() {
    return (
       <div>
        { /* change code below this line */ }
          <GetInput input = {this.state.inputValue} 
          handleChange input = {this.handleChange} />
          <RenderInput input = {this.state.inputValue} />
        { /* change code above this line */ }
       </div>
    );
  }
};

class GetInput extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <h3>Get Input:</h3>
        <input
          value={this.props.input}
          onChange={this.props.handleChange}/>
      </div>
    );
  }
};

class RenderInput extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <h3>Input Render:</h3>
        <p>{this.props.input}</p>
      </div>
    );
  }
};

#2

This line is the problem here. Try removing input here.


#3

Thanks so much…now works as expected…was a very challenging challenge for me