How does react get the real dom?

some problems with using AntD in the components of React

I want to get the value in the text box

class Demo extends Component {/ /

onChange () { / / events triggered by text box change
console.log (this.refs.input1) / / list of input details ( Input {props: { }, context: {. } and so on )
console.log (this.refs.input1.value) / / undefined
}

render () {
retrn (

)
 <Input ref="input1" onChange={this.onChange}/>

< / div >
)
}

Mar.29,2021

I caught
console.log (this.refs.input1.input.value)


The

onChange event provides the value of value.

<Input ref='input1' onChange={input => this.onChange(input)}/>


onChange(input) {
    const value = input.target.value;
    console.log(value); //Input
}
Menu