We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f05c033 commit 775beb0Copy full SHA for 775beb0
website/src/components/Testimonials/index.tsx
@@ -57,7 +57,18 @@ const getRandomTestimonial = () => {
57
};
58
59
export default function Testimonials(): JSX.Element {
60
- const review = getRandomTestimonial();
+ const [review, setReview] = React.useState<typeof testimonials[number] | null>(
61
+ null
62
+ );
63
+
64
+ React.useEffect(() => {
65
+ const randomIndex = Math.floor(Math.random() * testimonials.length);
66
+ setReview(testimonials[randomIndex]);
67
+ }, []);
68
69
+ if (!review) {
70
+ return null;
71
+ }
72
73
return (
74
<div className={styles.testimonialsList}>
0 commit comments