react-infinite-scroller icon indicating copy to clipboard operation
react-infinite-scroller copied to clipboard

Warning: Failed prop type: Invalid prop `element` supplied to `InfiniteScroll`, expected a ReactNode.

Open Togrias opened this issue 7 years ago • 5 comments

Complains of an invalid prop type when I set the prop element={CustomComponent} instead of defaults like "div".

Togrias avatar Sep 14 '18 05:09 Togrias

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.

danbovey avatar Sep 14 '18 10:09 danbovey

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>

henryruhs avatar Sep 24 '18 13:09 henryruhs

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 avatar Jan 11 '19 18:01 naokipeter

@naokipeter I've also got that warning in the same case. please share if you had any solution.

seeatend avatar Mar 21 '19 14:03 seeatend

you have getting any solution ?

1nevil avatar Oct 28 '22 08:10 1nevil