Answer the question
In order to leave comments, you need to log in
Why is the React component not updating?
I update the state
this.state = {
checked: this.props.checked //{1: true, 2: false, 3: false}
}
handleButton = () => {
let newstate = {1: false, 2: false, 3: false};
this.setState({
checked: newstate
})
}
}
Answer the question
In order to leave comments, you need to log in
Comparison goes only by links, superficially. Are you sure the button works? Or try to use a normal bind. There may be many options.
upd.
https://github.com/facebook/react/issues/4618
It says that defaultValue and defaultChecked are set only once during component initialization.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question