title: reactjs - export data to xlsx file using xlsx-style
body: <p>I am trying to export data to an excel file using xlsx-style, to add cells styling from the code.
  I wrote the following code, and the file is downloaded fine but without the styles.
  Does anyone have a solution for this?</p>
  <pre><code>    const addStyles = (workSheet) =&gt; {
          Object.entries(workSheet).filter(([k, v]) =&gt; k.charAt(0) === &quot;A&quot;).forEach(([k, v]) =&gt; {
              v.s = {
                  font: {
                      bold: true
                  }
              }
          })
      }
  
      const saveFile = () =&gt; {
          const json = getJsonData();
          const ws = XLSX.utils.json_to_sheet(json, { skipHeader: true });
          addStyles(ws);
          const wb = { Sheets: { 'data': ws }, SheetNames: ['data'] };
          const excelBuffer = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
          const fileData = new Blob([excelBuffer], { type: fileType });
          FileSaver.saveAs(fileData, fileName + fileExtension);
      }
  </code></pre>