react-data-export
react-data-export copied to clipboard
[feature] Added nested object key access for data and column match
The following has been addressed in the PR:
- There is a related #164
Description:
[feature]
Accessing nested object is available with this PR
In the value prop of ExcelColumn, you can now provide nested object path like "user.name" as in the example
const dataSet = [
{
user: {name: 'Mehmet', surname: 'Yılmaz'},
period: 'Eylül - Ekim'
},
{
user: {name: 'Semih', surname: 'Yavuz'},
period: 'Haziran - Temmuz'
}
]
class Download extends React.Component {
render() {
return (
<ExcelFile>
<ExcelSheet data={dataSet} name="Employees">
<ExcelColumn label="Name" value="user.name"/>
<ExcelColumn label="Period" value="period"/>
</ExcelSheet>
</ExcelFile>
);
}
}