-
Notifications
You must be signed in to change notification settings - Fork 430
Open
Description
Question
Is there a way to add the csv export button to the parent component?
Currently I have the table and the button in a child component, but want to move the button to the parent component and I can't get how to pass the props, any suggestions?
//parent
function Parent() {
return (
<>
{/* <ExportCSV { ...props.csvProps } /> */} {/* I want to move the button here */}
<TableContent data={data} />
</>
);
}
// child
function TableContent({data=[]}) {
return (
<ToolkitProvider
keyField="id"
data={data}
columns={columns}
>
{
props => (
<>
<ExportCSV { ...props.csvProps } />
<BootstrapTable
{ ...props.baseProps }
wrapperClasses="table-responsive"
rowClasses="text-nowrap"
noDataIndication="No Data"
striped
hover
condensed
/>
</>
)
}
</ToolkitProvider>
);
}
Metadata
Metadata
Assignees
Labels
No labels