react-polymer icon indicating copy to clipboard operation
react-polymer copied to clipboard

paper-datatable implementation

Open thisbounty opened this issue 7 years ago • 1 comments

I'm trying to add paper-datatable, and I'm running into an error with dataHost. My issue is detailed here:

https://stackoverflow.com/questions/44916580/add-paper-datatable-to-react-polymer-demo

thisbounty avatar Jul 05 '17 03:07 thisbounty

One problem is that React uses attributes instead of properties for custom elements. Attributes are just strings, but you need an array of objects. You can work around this by using ref. Try this (not tested):

const data = [
  {id: 0, title: 'Frozen yogurt', ...},
  {id: 1, title: 'Ice cream sandwich', ...}
]

<paper-datatable ref={ref => ref && ref.data = data} selectable multi-selection>
  ...
</paper-datatable>


jscissr avatar Jul 10 '17 13:07 jscissr