Skip to content
Snippets Groups Projects
Commit dd15e1e3 authored by Joseph Weston's avatar Joseph Weston
Browse files

set new state correctly

Previously the outer set of parentheses were interpreted as
function body, rather than a JSON literal
parent d4734571
Branches
Tags
No related merge requests found
......@@ -39,9 +39,9 @@ class Exams extends React.Component {
.then(new_exam => {
// if reall is new exam then add to list of exams
if (!this.state.exams.some(exam => new_exam.id == exam.id)) {
this.setState(prev => {
exams: [...prev.exams, new_exam]
})
this.setState(prev => ({
exams: [...prev.exams, new_exam],
}))
}
this.setState({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment