Youtube in React: update render function for search component + add infinite scroll
/* ... */ | |
import {VideoList} from '../../components/VideoList/VideoList'; | |
class Search extends React.Component { | |
render() { | |
return ( | |
<VideoList | |
bottomReachedCallback={this.bottomReachedCallback} | |
showLoader={true} | |
videos={this.props.searchResults}/> | |
); | |
} | |
/* ... */ | |
bottomReachedCallback = () => { | |
if(this.props.nextPageToken) { | |
this.props.searchForVideos(this.getSearchQuery(), this.props.nextPageToken, 25); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment