Skip to content

Commit 65e8759

Browse files
authored
Update Hero.tsx
Refactored. Also, is it ok that I used comments for readability and future maintainability to the code I added... I didn't find any comments in the code previously, is there some reason not to add comments?
1 parent 42e3270 commit 65e8759

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

components/Hero.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ function Hero() {
2020
if (search === '') {
2121
setErrorMessage('Empty search terms invalid!');
2222
return;
23-
} else {
24-
// Clear any previous error message & proceed to search
25-
setErrorMessage(null);
2623
}
24+
// Clear any previous error message & proceed to search
25+
setErrorMessage(null);
2726
router.push(`/repos/${search}`);
2827
};
2928
return (

0 commit comments

Comments
 (0)