Bunlong / react-papaparse

react-papaparse is the fastest in-browser CSV (or delimited text) parser for React. It is full of useful features such as CSVReader, CSVDownloader, readString, jsonToCSV, readRemoteFile, ... etc.
https://react-papaparse.js.org
MIT License
365 stars 61 forks source link

Trying to get correct JSON format (`header:true`) of uploaded CSV file #6

Closed grapes323 closed 4 years ago

grapes323 commented 4 years ago

Documentation is not consistent with code. Should be config instead of configOptions and onFileLoad instead of onFileLoaded. Code in Read.me section Header row support Instead of

<CSVReader
  onFileLoaded={this.handleReadCSV}
  inputRef={this.fileInput}
  style={{display: 'none'}}
  onError={this.handleOnError}
  configOptions={{header: true /* Header row support */ }}
/>

It should be

<CSVReader
  onFileLoad={this.handleReadCSV}
  inputRef={this.fileInput}
  style={{display: 'none'}}
  onError={this.handleOnError}
  config={{header: true /* Header row support */ }}
/>
Bunlong commented 4 years ago

@grapes323 I've updated the docs. Thank you for correction.

Bunlong commented 4 years ago

@grapes323 Could we close the issue? Thanks!