From 538702a581fdc81eee9d2453acbc4aebe137f34f Mon Sep 17 00:00:00 2001 From: Collin Barrett Date: Mon, 26 Feb 2018 17:06:08 -0600 Subject: [PATCH] move api fetch to componentDidMount for googlebot --- src/FilterLists.Web/ClientApp/components/Home.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/FilterLists.Web/ClientApp/components/Home.tsx b/src/FilterLists.Web/ClientApp/components/Home.tsx index eb6e2f51b..357298222 100644 --- a/src/FilterLists.Web/ClientApp/components/Home.tsx +++ b/src/FilterLists.Web/ClientApp/components/Home.tsx @@ -25,6 +25,12 @@ export class Home extends React.Component, IFilterListsS Loading...

: Home.renderFilterListsTable(this.state.filterLists); + return
+ {contents} +
; + } + + componentDidMount() { fetch("https://filterlists.com/api/v1/lists") .then(response => response.json() as Promise) .then(data => { @@ -33,9 +39,6 @@ export class Home extends React.Component, IFilterListsS loading: false }); }); - return
- {contents} -
; } private static renderFilterListsTable(filterLists: IFilterListSummaryDto[]) {