securedeveloper / react-data-export

Export dataset in react.
https://securedeveloper.github.io/react-data-export/
MIT License
179 stars 191 forks source link

Accessing Nested Objects #164

Open mehmetyilmaz001 opened 2 years ago

mehmetyilmaz001 commented 2 years ago

Accessing nested objects is not possible.

For example if you hava an array like this and and try to access the user.name it is not possible.

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"/>
                    <ExcelColumn label="Period" value="period"/>
                </ExcelSheet>
            </ExcelFile>
        );
    }
}