I want to write or overwrite data(or insert row) in a csv file within react-application(create-react-app) . My App.js file for now is -
import React, { Component} from 'react';
const csvData =[
['Ahmed', 'Tomi' , '[email protected]'] ,
['Raed', 'Labes' , '[email protected]'] ,
['Yezzi','Min l3b', '[email protected]']
];
export default class App extends Component {
render() {
return(
<div>
</div>
);
}
}
Here , I want to insert csvData in a csv file called data.csv within my react-application
my data.csv for now is :
Name,NickName,Email
Rahul B.,Rah,[email protected]
Abhinav K.,Abhi,[email protected]
Akshay G.,Aksh,[email protected]
where
Name,NickName,Email
are headers of my csv file .
I want my data.csv to look like -
Name,NickName,Email
Rahul B.,Rah,[email protected]
Abhinav K.,Abhi,[email protected]
Akshay G.,Aksh,[email protected]
Ahmed, Tomi , [email protected]
Raed, Labes , [email protected]
Yezzi,Min l3b,[email protected]
So how to update data.csv with my App component (React component) .
Thanks in advance .