Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Last active November 24, 2018 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/7677286f7a49debcffd0870ee21e87e4 to your computer and use it in GitHub Desktop.
Save productioncoder/7677286f7a49debcffd0870ee21e87e4 to your computer and use it in GitHub Desktop.
Youtube in React: VideoList component with infinite scroll
import React from 'react';
import {SideBar} from '../../containers/SideBar/SideBar';
import {InfiniteScroll} from '../InfiniteScroll/InfiniteScroll';
export class VideoList extends React.Component {
render() {
const videoPreviews = this.getVideoPreviews();
return (
<React.Fragment>
<SideBar/>
<div className='video-list'>
<InfiniteScroll bottomReachedCallback={this.props.bottomReachedCallback} showLoader={this.props.showLoader}>
{videoPreviews}
</InfiniteScroll>
</div>
</React.Fragment>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment