Created
February 16, 2018 05:50
-
-
Save Javran/3929edefa277558f4310ae18fa69527e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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