Skip to content

Instantly share code, notes, and snippets.

@sinthujan1999
Created June 18, 2020 01:50
Show Gist options
  • Save sinthujan1999/b38329313139e607dbef0474bca473d2 to your computer and use it in GitHub Desktop.
Save sinthujan1999/b38329313139e607dbef0474bca473d2 to your computer and use it in GitHub Desktop.
use the react js create simple form
import React from 'react'
class Form extends React.Component{
constructor(){
super()
this.state={
company:''
}
}
change(e) {
this.setState({
company:e.target.value
})
}
render(){
return(
<div>
<label> enter</label>
<input id="company" onChange={this.change}/>
<h2>yo:{this.state.company}</h2>
</div>
)
}
}
export default Form;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment