I am quite new to React and after going through some tutorials, I was trying the below code of mine.
I made one component, passed props to it from a store, on compo
I think it is best way for you.
You should add this: this.onTodoChange = this.onTodoChange.bind(this)
.
And your function has event param(e)
, and get value:
componentWillMount(){
this.setState({
updatable : false,
name : this.props.name,
status : this.props.status
});
this.onTodoChange = this.onTodoChange.bind(this)
}
onTodoChange(e){
const {name, value} = e.target;
this.setState({[name]: value});
}