Skip to content

Commit

Permalink
Fix config does not work in CSVReader
Browse files Browse the repository at this point in the history
  • Loading branch information
Bunlong authored Jan 20, 2022
2 parents 9e415b6 + 5c2c2e9 commit 2872726
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 4.0.1 (2022-01-21)

### ✨ Bugs

* Fix config props does not work in CSVReader

Credits

* [@jadenmazzone](https://github.com/jadenmazzone)

## 4.0.0 (2022-01-18)

### ✨ Features
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,11 @@ readRemoteFile(url, {

## 📜 Changelog

Latest version 4.0.0 (2022-01-18):
Latest version 4.0.1 (2022-01-21):

* Fix config props does not work in CSVReader

Version 4.0.0 (2022-01-18):

* Improve code performance
* Rewrite any existing based components to hooks
Expand Down
3 changes: 2 additions & 1 deletion src/useCSVReader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ function useCSVReaderComponent<T = any>() {
const reader = new window.FileReader();
let percentage = 0;

configs = Object.assign({}, config, configs);
acceptedFiles.forEach((file: File) => {
dispatch({
acceptedFile: file,
Expand Down Expand Up @@ -344,6 +343,8 @@ function useCSVReaderComponent<T = any>() {
setProgressBarPercentage(percentage);
},
};
configs = Object.assign({}, config, configs);

reader.onload = (e: any) => {
PapaParse.parse(e.target.result, configs);
};
Expand Down

0 comments on commit 2872726

Please sign in to comment.