diff options
Diffstat (limited to 'ui/src/components/communities.tsx')
-rw-r--r-- | ui/src/components/communities.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/src/components/communities.tsx b/ui/src/components/communities.tsx index 71ea878d..ba362acc 100644 --- a/ui/src/components/communities.tsx +++ b/ui/src/components/communities.tsx @@ -27,6 +27,10 @@ interface CommunitiesState { loading: boolean; } +interface CommunitiesProps { + page: number; +} + export class Communities extends Component<any, CommunitiesState> { private subscription: Subscription; private emptyState: CommunitiesState = { @@ -54,13 +58,13 @@ export class Communities extends Component<any, CommunitiesState> { this.subscription.unsubscribe(); } - static getDerivedStateFromProps(props) { + static getDerivedStateFromProps(props: any): CommunitiesProps { return { page: getPageFromProps(props), }; } - componentDidUpdate(_, lastState) { + componentDidUpdate(_: any, lastState: CommunitiesState) { if (lastState.page !== this.state.page) { this.setState({ loading: true }); this.refetch(); @@ -172,7 +176,7 @@ export class Communities extends Component<any, CommunitiesState> { ); } - updateUrl(paramUpdates: { page: number }) { + updateUrl(paramUpdates: CommunitiesProps) { const page = paramUpdates.page || this.state.page; this.props.history.push(`/communities/page/${page}`); } |