Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there a way to get csv file name in onload event ? #25

Closed
ntedgi opened this issue Jan 13, 2020 · 3 comments
Closed

is there a way to get csv file name in onload event ? #25

ntedgi opened this issue Jan 13, 2020 · 3 comments

Comments

@ntedgi
Copy link

ntedgi commented Jan 13, 2020

on load returns csv data without the file meta data

@nzambello
Copy link
Owner

Hi @ntedgi.
It's not implemented anything for this, yet.

In this line of code you can see where I get filename:
https://github.com/nzambello/react-csv-reader/blob/master/src/index.js#L20

We could add a method which, as a callback, provides the name of the file it's parsing.

@ntedgi
Copy link
Author

ntedgi commented Jan 14, 2020

great i saw that you pass the file name also as a parameter to the onFileLoaded callback
here :
https://github.com/nzambello/react-csv-reader/blob/acbcea4863e42bb8f42ea8716b13bac2bcf4de68/src/index.js#L30

i think it will be great if you change the basic example usage :

<CSVReader onFileLoaded={(data,fileName) => console.log(data)} />

thanks

@nzambello
Copy link
Owner

Oh right! I forgot that.
I've just updated README and the demo on CodeSandBox.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants