Skip to content

Commit 3cae870

Browse files
committed
fix(excelsheet): fix
#5
1 parent 0dc302a commit 3cae870

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/ExcelPlugin/elements/ExcelSheet.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ export interface ExcelSheetProps {
66
name: string;
77
data?: any[];
88
dataSet?: ExcelSheetData[];
9-
value: ExcelValue[] | (() => void);
10-
children: React.ReactElement<typeof ExcelColumn>[];
9+
value?: ExcelValue[] | (() => void);
10+
children?: React.ReactElement<typeof ExcelColumn>[];
1111
}
1212
export default class ExcelSheet extends Component<ExcelSheetProps> {
1313
constructor(props: ExcelSheetProps) {
1414
super(props);
1515

16-
if (!props.children.every((child) => child.type === ExcelColumn)) {
16+
if (!props.children?.every((child) => child.type === ExcelColumn)) {
1717
throw new Error("<ExcelSheet> can only have <ExcelColumn> as children");
1818
}
1919
}

types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ declare module 'react-xlsx-wrapper' {
1212
name: string;
1313
data?: any[];
1414
dataSet?: ExcelSheetData[];
15-
value: ExcelValue[] | (() => void);
16-
children: React.ReactElement | Array<React.ReactElement>;
15+
value?: ExcelValue[] | (() => void);
16+
children?: React.ReactElement | Array<React.ReactElement>;
1717
}
1818

1919
export interface ExcelSheetData {

0 commit comments

Comments
 (0)