May 2019
Intermediate to advanced
316 pages
7h 13m
English
One feature that we will also implement is a Comma-Separated Values (CSV) export of the data. There's a package called react-csv (https://github.com/abdennour/react-csv) that can be used to export an array of data to the CSV file.
If your app is running, stop the development server by pressing Ctrl + C in the Terminal, and type the following command to install react-csv. Post installation, restart the app:
npm install react-csv
The react-csv package contains two components—CSVLink and CSVDownload. We will use the first one in our app, so add the following import to the Carlist.js file:
import { CSVLink } from 'react-csv';
The CSVLink component takes the data prop, which contains the data array that will be exported to ...
Read now
Unlock full access