Skip to content

Commit 59b12ef

Browse files
committed
Export everything from DSVImport
1 parent c1ec0ef commit 59b12ef

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Flexible, typed and easy to use React Component ⚛ to provide CSV, TSV and other delimiter-separated values formats (DSV) import functionality.",
44
"keywords": ["react-component", "typescript", "react"],
55
"homepage": "https://openscript.github.io/react-dsv-import/",
6-
"version": "0.0.6",
6+
"version": "0.0.7",
77
"main": "dist/index.js",
88
"module": "dist/es/index.js",
99
"types": "dist/index.d.ts",

src/components/DSVImport.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ enum Separator {
88
export type ColumnsType<T> = { key: keyof T; label: string }[];
99

1010
interface Props<T> {
11-
onChange: (value: T[]) => void;
11+
onChange?: (value: T[]) => void;
1212
columns: ColumnsType<T>;
1313
}
1414

@@ -40,7 +40,9 @@ export const DSVImport = <T extends { [key: string]: string }>(props: PropsWithC
4040
return parsedLine;
4141
});
4242
setData(parsedData);
43-
props.onChange(parsedData);
43+
if (props.onChange) {
44+
props.onChange(parsedData);
45+
}
4446
};
4547

4648
const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {

src/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
import { DSVImport } from './components/DSVImport';
2-
3-
export { DSVImport };
1+
export * from './components/DSVImport';

0 commit comments

Comments
 (0)