es-lint is failing for this case: Return statement should not contain assignment no-return-assign
I've looked into this thread but to no avail: Arrow function should not return assignment no-return-assign
What can I do here to satisfy es-lint?
My State Variable
const [monthlyIncidents, setMonthlyIncidents] = useState([
// monthlyIncidents[0] -> January ... monthlyIncidents[11] -> December
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
])
How I'm Updating State
setMonthlyIncidents((prevIncidents) => {
return { ...prevIncidents, [incidentMonth]: monthlyIncidents[incidentMonth] += 1 }
})