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>
);
}
};