I have been following the tutorial for using Fixed Data Tables with React.
http://facebook.github.io/fixed-data-table/
Everything seems cool although the tutorial has a small amount of JSON directly in the app and not from an external source. I am looking to import mine from a github gist
the code i have so far is below.
I know i'm not pulling it in entirely correctly here so any help would be appreciated.
thanks
const rows = 'https://gist.githubusercontent.com/theuser/fwqgfwrgqw/raw/qwfefwqefrgthgtwg81bba6df90f46eaa5e7681c13/programmes.json'; ReactDOM.render( <Table height={rows.length * 30} width={1150} rowsCount={rows.length} rowHeight={30} headerHeight={30} rowGetter={function(rowIndex) {return rows[rowIndex]; }}> <Column dataKey="id" width={50} label="Id" /> <Column dataKey="name" width={200} label="Name" /> <Column dataKey="shortDescription" width={200} label="Description" /> <Column dataKey="active" width={400} label="Active Status" /> </Table>, document.getElementById('example') ); below is an example of the JSON
{ "id": 1938, "slug": "drivers-rebooted", "name": "test one", "shortName": "test one", "shortDescription": "Another look at some of the nation's oldest drivers.", "longDescription": "Another look at some of the nation's oldest drivers, including 102-year-old test yser who is determined to stay on the road - despite being barely able to hear.", "active": true, "type": "generic", "defaultExpiry": 30, "availableEpisodes": 2, "images": [ { "id": 456025, "filename": "456025-100-year-old-drivers-rebooted.jpg", "masterFilepath": "456\/", "_filepath": "http]" } ], },
import data from './data.json';for example