mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
move api fetch to componentDidMount for googlebot
This commit is contained in:
parent
92339a3060
commit
a480cb5cbc
1 changed files with 6 additions and 3 deletions
|
|
@ -25,6 +25,12 @@ export class Home extends React.Component<RouteComponentProps<{}>, IFilterListsS
|
|||
<em>Loading...</em>
|
||||
</p>
|
||||
: Home.renderFilterListsTable(this.state.filterLists);
|
||||
return <div>
|
||||
{contents}
|
||||
</div>;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
fetch("https://filterlists.com/api/v1/lists")
|
||||
.then(response => response.json() as Promise<IFilterListSummaryDto[]>)
|
||||
.then(data => {
|
||||
|
|
@ -33,9 +39,6 @@ export class Home extends React.Component<RouteComponentProps<{}>, IFilterListsS
|
|||
loading: false
|
||||
});
|
||||
});
|
||||
return <div>
|
||||
{contents}
|
||||
</div>;
|
||||
}
|
||||
|
||||
private static renderFilterListsTable(filterLists: IFilterListSummaryDto[]) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue