How to create and download CSV - React client-side edition

Uros Randelovic
1 min readJul 20, 2020

Our customers always rely on Excel to dive deep into the data thus we have to provide them with a friendly format to do so. There are of course libraries that will do this for you but I found them a little hard to use when the data is nested 3–4 levels and needs to be shown serially.

Before we dive into the code, install the library called ‘file-saver’ like so:

yarn add file-save --s

and import function saveAs up top, then proceed as below:

--

--