score:4

Accepted answer
{
    variants.map(variant => (
        <MenuItem key={variant.id} value={variant}>
            <Checkbox
                checked={
                    variantName.findIndex(item => item.id === variant.id) >= 0
                }
            />
            <ListItemText primary={variant.name} />
        </MenuItem>
    ));
}

Related Query

More Query from same tag