RELEASE 🚒 : 1.0.2
Ability of specifying the "filename" of the downloaded CSV file .
```
<CSVLink filename={"persons.csv"} data={data}>Click here</CSVLink>
```
This commit is contained in:
parent
c5053cf334
commit
d4544e117e
9 changed files with 4259 additions and 27 deletions
|
|
@ -126,12 +126,16 @@ It renders a hyperlink , and clicking on it will trigger the download action of
|
|||
|
||||
It does not accept only `data` and `headers` props , but also , it rendered all props of `HTMLAnchor` tag. (className, target,....)
|
||||
|
||||
### - **filename** Props:
|
||||
`filename` is another props restricted to `CSVLink`. It specifies the filename of the downloaded CSV .
|
||||
|
||||
**example**
|
||||
|
||||
```js
|
||||
import {CSVLink} from 'react-csv';
|
||||
|
||||
<CSVLink data={data}
|
||||
filename={"my-file.csv"}
|
||||
className="btn btn-primary"
|
||||
target="_blank">
|
||||
Download me
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue