json-to-csv-export icon indicating copy to clipboard operation
json-to-csv-export copied to clipboard

not all key/values converted if not in the first object

Open rg3h opened this issue 1 year ago • 0 comments

// from https://json-to-csv-export.vercel.app/ // bar will be in the exported csv but foo will not // results: // ID,First Name,Last Name,Email,Language,bar,IP Address // 1,Sarajane,Wheatman,[email protected],Zulu,1234,40.98.252.240 // 2,Linell,Humpherston,[email protected],Czech,,82.225.151.150

() => { const mockData = [{ "ID": 1, "First Name": "Sarajane", "Last Name": "Wheatman", "Email": "[email protected]", "Language": "Zulu", "bar": 1234, "IP Address": "40.98.252.240" }, { "ID": 2, "foo": 4, "First Name": "Linell", "Last Name": "Humpherston", "Email": "[email protected]", "Language": "Czech", "IP Address": "82.225.151.150" }]

return ( <button onClick={() => jsonToCsvExport({ data: mockData })}> Download Data ) }

rg3h avatar Aug 01 '24 18:08 rg3h