Skip to content

Commit 1ea415d

Browse files
committed
refactor out useEffect
1 parent 6b672b5 commit 1ea415d

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/components/Contributors.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { useEffect, useState } from "react"
2-
import { shuffle } from "lodash"
31
import { Box, Flex, Image, LinkBox, LinkOverlay } from "@chakra-ui/react"
42

53
import InlineLink from "@/components/Link"
@@ -16,14 +14,7 @@ export interface Contributor {
1614
}
1715

1816
const Contributors = () => {
19-
const [contributorsList, setContributorsList] = useState<Array<Contributor>>(
20-
[]
21-
)
22-
useEffect(() => {
23-
const list = shuffle(JSON.parse(data).contributors)
24-
setContributorsList(list)
25-
// eslint-disable-next-line react-hooks/exhaustive-deps
26-
}, [])
17+
const contributorsList = JSON.parse(data).contributors
2718

2819
return (
2920
<>

0 commit comments

Comments
 (0)