I want to import this react-infinite-scroller react library in a rails project but meet some problems. After I installed it, I could not import it using import InfiniteScroll from 'react-infinite-scroller';
or var InfiniteScroll = require('react-infinite-scroller')['default'];
in application.js. There would be a SyntaxError: unterminated string literal
for the first one and ReferenceError: require is not defined
for the second one.
I also tried this library react-infinite and installed it using bower. I used like this
<react-infinite containerHeight={200} elementHeight={40}>
<ContentTable
data={this.state.tableData}
filterText={this.state.filterText}
onUserClick={this.handleUserClick}
dataType={this.props.dataType}
showPublic={this.state.publicCheckbox}
/>
</react-infinite>
It was imported I guess because I could see the component in the html.
But there was no infinite scrolling on the table.
I think react-infinite-scroller might save me because I saw Is it possible to add infinite scrolling to React Tool Box Table body?. But I could not import it right.
This project is 5 years old and I am new to react. Could someone save me? Thanks.