-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/result loading #2
Conversation
useEffect(() => { | ||
const emojiInterval = setInterval(() => { | ||
setCurrentEmojiIndex((prevIndex) => (prevIndex + 1) % emojis.length); | ||
}, 1000); // 1초마다 이모지를 변경 | ||
|
||
return () => clearInterval(emojiInterval); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useEffect(function changeEmojiByInterval() {
const emojiInterval = setInterval(() => {
setCurrentEmojiIndex((prevIndex) => (prevIndex + 1) % emojis.length);
}, 1000);
return () => clearInterval(emojiInterval);
}, [])
useEffect 사용시에 콜백함수에 익명함수가 아닌 특정 effect 를 실행한다는 것을 작명한 함수를 사용하면 코드가 더 깔끔할 것 같아요!
let index = 0; | ||
let isDeleting = false; | ||
let typeTimeout: NodeJS.Timeout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useRef
로 변경하면 좋을것 같습니다!
const [displayedText, setDisplayedText] = useState(""); | ||
const [currentTextIndex, setCurrentTextIndex] = useState(0); | ||
const [isCursorBlinking, setIsCursorBlinking] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제네릭으로 타입 지정해주세요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!! 😊
구현한 기능
논의하고 싶은 내용
(서로 그 방법에 대한 논의가 필요할 것 같음)
기타