From 6d0d0e5053f0408ad97b52f185f96a64cc45f872 Mon Sep 17 00:00:00 2001 From: StevanFreeborn Date: Sat, 25 Jun 2022 14:59:59 -0500 Subject: [PATCH 1/2] conditionally render home page after characters are gotten --- client/src/pages/home.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/client/src/pages/home.js b/client/src/pages/home.js index 87a5022..c93deba 100644 --- a/client/src/pages/home.js +++ b/client/src/pages/home.js @@ -41,12 +41,18 @@ export default function Home() { } + characters = characters; + return ( <> - - - {getCharacterCards()} - + {characters.length > 0 ? + <> + + + {getCharacterCards()} + + + : null} ); } \ No newline at end of file From 415aa4b215b0553487892a2884e238ddbea0bbc1 Mon Sep 17 00:00:00 2001 From: StevanFreeborn Date: Sat, 25 Jun 2022 15:00:22 -0500 Subject: [PATCH 2/2] removed unnecessary statement --- client/src/pages/home.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/src/pages/home.js b/client/src/pages/home.js index c93deba..5df733a 100644 --- a/client/src/pages/home.js +++ b/client/src/pages/home.js @@ -41,8 +41,6 @@ export default function Home() { } - characters = characters; - return ( <> {characters.length > 0 ?