try waiting to fetch until after render for googlebot

This commit is contained in:
Collin Barrett 2018-02-26 16:56:32 -06:00
parent 3bd6bf7706
commit 0e2916358b

View file

@ -17,14 +17,6 @@ export class Home extends React.Component<RouteComponentProps<{}>, IFilterListsS
filterLists: [],
loading: true
};
fetch("https://filterlists.com/api/v1/lists")
.then(response => response.json() as Promise<IFilterListSummaryDto[]>)
.then(data => {
this.setState({
filterLists: data,
loading: false
});
});
}
render() {
@ -33,6 +25,14 @@ export class Home extends React.Component<RouteComponentProps<{}>, IFilterListsS
<em>Loading...</em>
</p>
: Home.renderFilterListsTable(this.state.filterLists);
fetch("https://filterlists.com/api/v1/lists")
.then(response => response.json() as Promise<IFilterListSummaryDto[]>)
.then(data => {
this.setState({
filterLists: data,
loading: false
});
});
return <div>
{contents}
</div>;