From 6ce9482b22d6cfd234169fe6706e388e20322e38 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Wed, 16 Oct 2019 19:15:39 +0200 Subject: [PATCH] fix: stop quotes reloading (#37342) --- client/src/components/welcome/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/components/welcome/index.js b/client/src/components/welcome/index.js index 2398c505c8..6b18041469 100644 --- a/client/src/components/welcome/index.js +++ b/client/src/components/welcome/index.js @@ -7,8 +7,12 @@ import { randomQuote } from '../../utils/get-words'; import './welcome.css'; +// created outside the function, so that the quotes don't change unless the +// page is reloaded. + +const { quote, author } = randomQuote(); + function Welcome({ name }) { - const { quote, author } = randomQuote(); return (