1

I want to download one CSV file in my React Native Project. I have put CSV file in assets folder in React Native Project, I'm using RNFS for fetching the same.

But when I console log RNFS.MainBundlePath it returns undefined value. Below is my Code to get the path from RNFS.

var mainBundlePath = RNFS.MainBundlePath;
var path = '/assets/Product.csv';

Any suggestions on this matter?

Andrei Fiordean
  • 223
  • 3
  • 14
Amit Shetye
  • 133
  • 1
  • 11

1 Answers1

0

There you can user below library it will help me to achieve same thing in past.

Try csvtojson

you can Installation

npm i --save csvtojson

see the example given here

Hardik Virani
  • 1,687
  • 7
  • 23
  • 36