1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Merge pull request #1919 from samlanning/inconsistent-state-update

fix inconsistent updates to react component state
This commit is contained in:
Junyoung Choi (Sai)
2018-05-15 19:30:22 +09:00
committed by GitHub
2 changed files with 21 additions and 21 deletions

View File

@@ -55,10 +55,10 @@ class SnippetTab extends React.Component {
this.handleRename()
break
case 27:
this.setState({
name: this.props.snippet.name,
this.setState((prevState, props) => ({
name: props.snippet.name,
isRenaming: false
})
}))
break
}
}