From 310bcc4a1d0ce4d2db998834bdea2f288f99ab96 Mon Sep 17 00:00:00 2001 From: Haryana Date: Sat, 19 Sep 2020 05:29:39 +0700 Subject: [PATCH] fix export type for ExportCSVButton (#46829) --- .../react-bootstrap-table2-toolkit/index.d.ts | 2 +- .../react-bootstrap-table2-toolkit-tests.tsx | 35 +++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/types/react-bootstrap-table2-toolkit/index.d.ts b/types/react-bootstrap-table2-toolkit/index.d.ts index 0a403e6cf5..3de3177b26 100644 --- a/types/react-bootstrap-table2-toolkit/index.d.ts +++ b/types/react-bootstrap-table2-toolkit/index.d.ts @@ -106,7 +106,7 @@ export interface ExportCSVButtonProps { } export namespace CSVExport { - function ToggleList(props: ExportCSVButtonProps): React.ReactElement | null; + function ExportCSVButton(props: ExportCSVButtonProps): React.ReactElement | null; } export interface SearchBarProps { diff --git a/types/react-bootstrap-table2-toolkit/react-bootstrap-table2-toolkit-tests.tsx b/types/react-bootstrap-table2-toolkit/react-bootstrap-table2-toolkit-tests.tsx index 447f368d7e..b379c8d7b7 100644 --- a/types/react-bootstrap-table2-toolkit/react-bootstrap-table2-toolkit-tests.tsx +++ b/types/react-bootstrap-table2-toolkit/react-bootstrap-table2-toolkit-tests.tsx @@ -7,7 +7,7 @@ import BootstrapTable, { } from 'react-bootstrap-table-next'; import paginationFactory from 'react-bootstrap-table2-paginator'; import { render } from 'react-dom'; -import ToolkitProvider, { InjectedSearchProps, Search } from 'react-bootstrap-table2-toolkit'; +import ToolkitProvider, { InjectedSearchProps, Search, CSVExport } from 'react-bootstrap-table2-toolkit'; interface Product { id: number; @@ -176,15 +176,38 @@ const { SearchBar, ClearSearchButton } = Search; render( {({ baseProps, searchProps }) => ( <> - - - + + + + + )} + , + document.getElementById('app'), +); + +/** + * Toolkit CSVExport with ExportCSVButton + */ + +const { ExportCSVButton } = CSVExport; + +render( + + {({ baseProps, csvProps }) => ( + <> + Export + )} ,