react-csv / react-csv

React components to build CSV files on the fly basing on Array/literal object of data

Home Page:http://react-csv.github.io/react-csv/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Columns appearing in different orders

Shelby-Jean opened this issue · comments

When exported, sometimes columns appear in different orders and I'm unsure why. Has anyone else encountered this or know a fix? TIA!

image
image

Send sample data to replicate.

@Shelby-Jean Are you using JSON data as input ? If it's the case, I think that the attribute of some objects may be in the wrong place or undefined. I think it's safer to provider the "headers" prop in order to make sure columns appear in the right order. Like @thatPranav a sample data maybe helpful to identify the issue.

@marrouchi comment is fair enough