1class Parent extends Component {
2 constructor() {
3 this.state = {
4 value: ''
5 };
6 }
7
8 //...
9
10 handleChangeValue = e => this.setState({value: e.target.value});
11
12 //...
13
14 render() {
15 return (
16 <Child
17 value={this.state.value}
18 onChangeValue={this.handleChangeValue}
19 />
20 );
21 }
22}
23
24class Child extends Component {
25 //...
26
27 render() {
28 return (
29 <input
30 type="text"
31 value={this.props.value}
32 onChange={this.props.onChangeValue}
33 />
34 );
35 }
36}
37