I am using react csv for generating excel file.
I got a sample data downloaded but to download the JSON data, I am not sure how to pass the JSON files from RecipeReviewCardList file to tab-demo.js file.
Can you tell me how to pass the data providing my code changes and sandbox below ?
This will help me to learn more and fix the issues by myself in future. https://codesandbox.io/s/ko1q2x233
tab-demo.js
<div>
230 sports | test Export Excel | Export PDF
<CSVLink data={csvData}>Download me</CSVLink>;
<CSVDownload data={csvData} target="_blank" />;
</div>
RecipeReviewCardList.js
getCommentsData() {
let comments = [];
fetch("https://jsonplaceholder.typicode.com/comments")
.then(response => response.json())
.then(json => {
comments = json;
// comments = comments.slice(0,3);
this.setState({ comments: comments });
this.setState({ activeComments: comments.slice(0, 10) });
//console.log(comments);