From f451d94295d18d32e053781d53f08269a8ec7b37 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Thu, 27 Jan 2022 14:46:23 -0600 Subject: [PATCH] feedCreate: use hook for randIndex --- web/components/feed-create.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/components/feed-create.tsx b/web/components/feed-create.tsx index 2565b543..c7c0c1a4 100644 --- a/web/components/feed-create.tsx +++ b/web/components/feed-create.tsx @@ -74,7 +74,9 @@ export default function FeedCreate(props: { // Easter egg idea: click your own name to shuffle the placeholder // const daysSinceEpoch = Math.floor(Date.now() / 1000 / 60 / 60 / 24) - const randIndex = Math.floor(Math.random() * 1e10) % placeholders.length + const [randIndex] = useState( + Math.floor(Math.random() * 1e10) % placeholders.length + ) const placeholder = props.placeholder ?? `e.g. ${placeholders[randIndex]}` return (