I have code in a React file like this:
import {Dropdown, DropdownButton, MenuItem} from "react-bootstrap";
import {CSVLink} from "react-csv";
<DropdownButton id={'sdfsd'} title={
<>
<img src={exportIcon}/>Export
</>
}>
<MenuItem>
<CSVLink data={myCsvData} filename={`first-case.csv`}>First Case</CSVLink>
</MenuItem>
<MenuItem>
<CSVLink data={mySecondCsvData} className="link" filename={`second-case.csv`}>Second Case</CSVLink>
</MenuItem>
</DropdownButton>
You can see that the CSVLink
is wrapped inside MenuItem
. It's used to download Excel sheet with the data, but it's not working now. When I click on it, nothing is happening.
How to make it work?