Skip to content

Instantly share code, notes, and snippets.

@MrMjauh
Last active June 3, 2019 17:53
Show Gist options
  • Save MrMjauh/d1ac9a23c01364afa90c2407dbc70e48 to your computer and use it in GitHub Desktop.
Save MrMjauh/d1ac9a23c01364afa90c2407dbc70e48 to your computer and use it in GitHub Desktop.
Connected component
export class Explore extends React.Component<Props, State> {
public render() {
const req: PageableSearchResult<string> | undefined = this.getRequest();
return (
<Pagination<number>
ref={this.paginationRef}
lastSyncedPage={this.lastSyncedPage()}
requestPage={(page: number) => this.requestPage(page)}
nextPage={() => req != null && req.next != null ? req.next : undefined}
>
... some data
</Pagination>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment