I am getting the linting error
Must use destructuring files assignment react/destructuring-assignment
For the code below
const showFiles = label => (files) =>
(
<>
{files.map(({ name }, index) => (
<Typography key={`${label}-file-${index}`}>{name}</Typography>
))}
</>
);
I tried changing it to this
const showFiles = label => ({ map }) =>
(
<>
{map(({ name }, index) => (
<Typography key={`${label}-file-${index}`}>{name}</Typography>
))}
</>
);
This makes the linting error go away but then the actual webpage has the following error.
TypeError: can't convert undefined to object
Is there a way around this linting error that I am not seeing? Do I have to use Array.prototypes.map or something?