From 0e2916358bd71fffe41a1c6f3fe4ae1f4c875b72 Mon Sep 17 00:00:00 2001 From: Collin Barrett Date: Mon, 26 Feb 2018 16:56:32 -0600 Subject: [PATCH] try waiting to fetch until after render for googlebot --- .../ClientApp/components/Home.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/FilterLists.Web/ClientApp/components/Home.tsx b/src/FilterLists.Web/ClientApp/components/Home.tsx index 51f999092..eb6e2f51b 100644 --- a/src/FilterLists.Web/ClientApp/components/Home.tsx +++ b/src/FilterLists.Web/ClientApp/components/Home.tsx @@ -17,14 +17,6 @@ export class Home extends React.Component, IFilterListsS filterLists: [], loading: true }; - fetch("https://filterlists.com/api/v1/lists") - .then(response => response.json() as Promise) - .then(data => { - this.setState({ - filterLists: data, - loading: false - }); - }); } render() { @@ -33,6 +25,14 @@ export class Home extends React.Component, IFilterListsS Loading...

: Home.renderFilterListsTable(this.state.filterLists); + fetch("https://filterlists.com/api/v1/lists") + .then(response => response.json() as Promise) + .then(data => { + this.setState({ + filterLists: data, + loading: false + }); + }); return
{contents}
;