Skip to content

Commit fc32179

Browse files
committed
Fix TypeScript error: ensure all code paths return value in useEffect
- Add explicit return undefined in else block of useEffect - Fixes GitHub Action deployment failure - Resolves TS7030: Not all code paths return a value
1 parent 198e55d commit fc32179

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/components/TextGenerator/QuizSection.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,15 @@ const QuizSection = () => {
175175

176176
useEffect(() => {
177177
if (isAnswered) {
178-
const timer = setTimeout(() => { setShowCorrectAnswer(true); }, 2000);
179-
return () => { clearTimeout(timer); };
178+
const timer = setTimeout(() => {
179+
setShowCorrectAnswer(true);
180+
}, 2000);
181+
return () => {
182+
clearTimeout(timer);
183+
};
180184
} else {
181185
setShowCorrectAnswer(false);
186+
return undefined;
182187
}
183188
}, [isAnswered]);
184189
const handleAsyncClick = useCallback(

0 commit comments

Comments
 (0)