react-infinite-scroller
react-infinite-scroller copied to clipboard
Warning: Failed prop type: Invalid prop `element` supplied to `InfiniteScroll`, expected a ReactNode.
Complains of an invalid prop type when I set the prop element={CustomComponent} instead of defaults like "div".
This should have been fixed in #152.
Can you share the full use of InfiniteScroll and the typeof CustomComponent. You should be able to render a React Component class or stateless function as a custom element.
I have the same error message under IE11 for some reason. Not using the element property at all...
This is how to reproduce it:
<InfiniteScroll loadMore={ this.loadMore } hasMore={ this.hasMore }>
<div>test</div>
</InfiniteScroll>
I'm getting this error when I use element={TableBody} from Material UI.
import { Table, TableBody, TableRow, TableCell } from '@material-ui/core';
<Table>
{* ... *}
<InfiniteScroll
element={TableBody}
pageStart={0}
loadMore={this.loadNextPage}
loader={<tr className="loader" key={0}><td colspan="4">Loading ...</td></tr>}
useWindow={false}
getScrollParent={() => this.scrollParentRef}
>
{rows}
</InfiniteScroll>
</Table>
@naokipeter I've also got that warning in the same case. please share if you had any solution.
you have getting any solution ?