All,
I'm trying to combine FlexTable and AutoSizer (from react-virtualized) but keep getting an error that I do not quite see the reason for. As far as I can see I have followed the examples but I must be making some mistake.
My render method ends with the following
return (
<AutoSizer disableWidth>
{({ height }) => (
<FlexTable
ref='Table'
className={'FlexTable'}
headerClassName={'headerColumn'}
headerHeight={35}
height={height}
noRowsRenderer={this._noRowsRenderer}
rowClassName={::this._rowClassName}
onRowClick={this._onClick}
rowHeight={30}
rowGetter={this._rowGetter}
rowsCount={this.state.sorted.length}
sort={this._sort}
sortBy={sortBy}
sortDirection={sortDirection}
width={370}>
<FlexColumn label='Org-Nr' dataKey='clientNumber' width={115}/>
<FlexColumn label='Namn' dataKey='name' width={255}/>
</FlexTable>
)}
</AutoSizer>
)
and what happens is that the console shows me the following warnings and the table is never rendered.
Warning: Failed propType: Invalid prop
children
supplied toAutoSizer
, expected a single ReactElement. Check the render method ofTable
.
and
Uncaught Invariant Violation: onlyChild must be passed a children with exactly one child.
Now, I do understand what it is telling me I just don't see how the AutoSizer tag is given more that one child. Isn't the only child the FlexTable component?
Best regards
Daniel Södling