react-data-export icon indicating copy to clipboard operation
react-data-export copied to clipboard

Accessing Nested Objects

Open mehmetyilmaz001 opened this issue 3 years ago • 0 comments

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>
        );
    }
}

mehmetyilmaz001 avatar Oct 09 '21 17:10 mehmetyilmaz001