tengo una matriz
const reportOptions = [ { id: 1, title: 'Report', }, { id: 2, title: 'Report 2', }, { id: 3, title: 'Report 3', }, ]Intento crear un nuevo estado como el siguiente.
const [isReportsDownloading, setIsReportsDownloading] = useState( reportOptions.map(opt => { return { ...opt, isDownloading: false } }) )me da este error
Unexpected block statement surrounding arrow body; parenthesize the returned value and move it immediately after the `=>`¿Como arreglar?
Creo que el error significa esto, aunque su código original ya parece válido, tal vez solo sea un error de eslint.
const [isReportsDownloading, setIsReportsDownloading] = useState( reportOptions.map((opt) => ({ ...opt, isDownloading: false })) );