🐛 fix(type): Fix ts type check error

This commit is contained in:
web@ppanel
2025-01-28 13:55:43 +07:00
parent 1d8c765c14
commit 3cb0629d64
3 changed files with 17 additions and 23 deletions
+3 -3
View File
@@ -69,7 +69,7 @@ export default function HyperText({
const observer = new IntersectionObserver(
([entry]) => {
if (entry.isIntersecting) {
if (entry?.isIntersecting) {
setTimeout(() => {
setIsAnimating(true);
}, delay);
@@ -100,8 +100,8 @@ export default function HyperText({
letter === ' '
? letter
: index <= iterationCount.current
? children[index]
: characterSet[getRandomInt(characterSet.length)],
? (children[index] ?? ' ')
: (characterSet[getRandomInt(characterSet.length)] ?? ' '),
),
);
iterationCount.current = iterationCount.current + 0.1;