0

What is the proper way to access the data, rowData, and metadata props on a custom Griddle component? Despite seeing the props populated with my data in the react devtools (e.g. url and title for a link I want to build) the console gives me an error of "Unknown props rowData, metadata on <DownloadLink> tag".

I've tried two approaches based on passing a customComponentMetadata key/value and the way the documentation shows as per this, this, and the documentation.

const columnMetaData = [
  // several objects until...,
  {
    customComponent: 'DownloadLink', // which I import from './components/DownloadLink'
    customComponentMetadata: {
      fileDetails: fileDetails // my array with url and title
    }
  }
];

My table receives this as props - <ResultsTable columnMetadata={columnMetadata} tableData={this.state.tableData} /> // tableData is the entire json object I want to display.

Any help would be great. Thanks!

Community
  • 1
  • 1
aberkow
  • 330
  • 1
  • 10
  • what do you get if you do a console.log(this.props) in your DownloadLink render method/? – finalfreq Jan 18 '17 at 21:51
  • @finalfreq - That's just it. Nothing. The reason seems to be that in Griddle it doesn't seem like you explicitly pass props to a custom grid component in that way. Usually I would do something like ` ` However according to the docs all you (should) have to do is register the component with the columnMetadata prop for the table. NB - every other prop works and I can _see_ but not access the data in the custom component. – aberkow Jan 19 '17 at 13:39
  • It turns out I was going about this wrong. The customComponent should not have quotes. I made this [gist](https://gist.github.com/aberkow/f2b82cfed572ad21f17053e39b9ddb71) as an example. – aberkow Mar 30 '17 at 19:06

0 Answers0