Skip to content

Commit 2872726

Browse files
authored
Fix config does not work in CSVReader
2 parents 9e415b6 + 5c2c2e9 commit 2872726

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 4.0.1 (2022-01-21)
2+
3+
### ✨ Bugs
4+
5+
* Fix config props does not work in CSVReader
6+
7+
Credits
8+
9+
* [@jadenmazzone](https://github.com/jadenmazzone)
10+
111
## 4.0.0 (2022-01-18)
212

313
### ✨ Features

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,11 @@ readRemoteFile(url, {
886886

887887
## 📜 Changelog
888888

889-
Latest version 4.0.0 (2022-01-18):
889+
Latest version 4.0.1 (2022-01-21):
890+
891+
* Fix config props does not work in CSVReader
892+
893+
Version 4.0.0 (2022-01-18):
890894

891895
* Improve code performance
892896
* Rewrite any existing based components to hooks

src/useCSVReader.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ function useCSVReaderComponent<T = any>() {
298298
const reader = new window.FileReader();
299299
let percentage = 0;
300300

301-
configs = Object.assign({}, config, configs);
302301
acceptedFiles.forEach((file: File) => {
303302
dispatch({
304303
acceptedFile: file,
@@ -344,6 +343,8 @@ function useCSVReaderComponent<T = any>() {
344343
setProgressBarPercentage(percentage);
345344
},
346345
};
346+
configs = Object.assign({}, config, configs);
347+
347348
reader.onload = (e: any) => {
348349
PapaParse.parse(e.target.result, configs);
349350
};

0 commit comments

Comments
 (0)