mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
fix export type for ExportCSVButton (#46829)
This commit is contained in:
parent
dacb312e7e
commit
310bcc4a1d
@ -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 {
|
||||
|
||||
@ -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(
|
||||
<ToolkitProvider
|
||||
keyField="id"
|
||||
data={ products }
|
||||
columns={ productColumns }
|
||||
data={products}
|
||||
columns={productColumns}
|
||||
search
|
||||
>
|
||||
{({ baseProps, searchProps }) => (
|
||||
<>
|
||||
<SearchBar { ...searchProps } />
|
||||
<ClearSearchButton { ...searchProps } />
|
||||
<BootstrapTable { ...baseProps } />
|
||||
<SearchBar {...searchProps} />
|
||||
<ClearSearchButton {...searchProps} />
|
||||
<BootstrapTable {...baseProps} />
|
||||
</>
|
||||
)}
|
||||
</ToolkitProvider>,
|
||||
document.getElementById('app'),
|
||||
);
|
||||
|
||||
/**
|
||||
* Toolkit CSVExport with ExportCSVButton
|
||||
*/
|
||||
|
||||
const { ExportCSVButton } = CSVExport;
|
||||
|
||||
render(
|
||||
<ToolkitProvider
|
||||
keyField="id"
|
||||
data={products}
|
||||
columns={productColumns}
|
||||
search
|
||||
>
|
||||
{({ baseProps, csvProps }) => (
|
||||
<>
|
||||
<ExportCSVButton {...csvProps}>Export</ExportCSVButton>
|
||||
<BootstrapTable {...baseProps} />
|
||||
</>
|
||||
)}
|
||||
</ToolkitProvider>,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user