Skip to content

Instantly share code, notes, and snippets.

@Javran
Created February 16, 2018 05:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Javran/3929edefa277558f4310ae18fa69527e to your computer and use it in GitHub Desktop.
Save Javran/3929edefa277558f4310ae18fa69527e to your computer and use it in GitHub Desktop.
render() {
const {ships} = this.props
const fakeRenderer = propName => props => (<div>{props[propName]}</div>)
return (
<div
style={{
flex: 1,
height: 0,
}}
>
<AutoSizer>
{
({width, height}) => (
<Table
width={width}
height={height}
headerHeight={20}
rowCount={ships.length}
rowGetter={({index}) => ships[index]}
rowHeight={20}
>
<Column
label="ID"
disableSort={true}
dataKey="rstId"
cellRenderer={fakeRenderer('cellData')}
width={200}
/>
<Column
label="Name"
disableSort={true}
dataKey="name"
cellRenderer={fakeRenderer('cellData')}
width={200}
/>
</Table>
)
}
</AutoSizer>
</div>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment