Use spread instead of concat

pull/1855/head
Andrew Watkins 2017-08-14 14:20:46 -07:00
parent 0ed9b8199c
commit c34770091d
1 changed files with 6 additions and 3 deletions

View File

@ -115,10 +115,13 @@ class CellEditorOverlay extends Component {
handleAddQuery() {
const {queriesWorkingDraft} = this.state
const newIndex = queriesWorkingDraft.length
const newQuery = {...defaultQueryConfig(uuid.v4())}
const nextQueries = queriesWorkingDraft.concat(newQuery)
this.setState({queriesWorkingDraft: nextQueries})
this.setState({
queriesWorkingDraft: [
...queriesWorkingDraft,
defaultQueryConfig(uuid.v4()),
],
})
this.handleSetActiveQueryIndex(newIndex)
}