Return to site
· data binding,React js,WebApps,Web Development
broken image

Data binding is a process of binding a UI component like textbox and code behind the object. For example, your input is:


Data binding can be done using controlled input. Controlled input is gained by binding value to a state variable and onChange event to change the state as the input value changes.

constructor() {

super();

this.state = {value : ''}

}

handleChange = (e) =>{

this.setState({value: e.target.value});

}

render() {

return (

{this.state.value}

)

}

}

ReactDOM.render(, document.getElementById('app'));Read more