XLSX not works in UI Kit

I would like to export the data in excel. Refer below snippet.

import * as XLSX from 'xlsx';
import * as FS from 'fs';

export const myExportToExcel = (data, fileName) => {

    XLSX.set_fs(FS);
    const ws = XLSX.utils.json_to_sheet(data);
    const wb = XLSX.utils.book_new();
    XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
    //XLSX.writeFile(wb, fileName || 'data.xlsx', { compression: true });
    XLSX.writeFileXLSX(wb, fileName, { compression: true });
};

While running, clicking on the button it does not download excel file. There is no error in console as well.

Any idea, if i miss something or any other work around?

Hi @PrabuN1,

Apologies for the slow reply.
It seems like in your example above you were using UI Kit 1 which is in the process of being deprecated.
In the latest version of UI Kit, this should be working as expected.

I would recommend trying this in the latest version of UI Kit once you have migrated your app.

I hope this helps.
Thanks!
Mel