Fix uncleaned setTimeout in useTypingEffect hook

Refactor useTypingEffect to use a single useEffect with proper cleanup for all timers, preventing state updates on unmounted components.
Add unit tests to verify behavior and ensure no memory leaks on unmount.
This commit is contained in:
google-labs-jules[bot]
2026-01-22 04:43:55 +00:00
parent eea2e71b03
commit 8f820e262f
4 changed files with 866 additions and 25 deletions

View File

@@ -24,10 +24,14 @@
"react-router-dom": "^7.12.0"
},
"devDependencies": {
"@testing-library/dom": "^10.4.1",
"@testing-library/react": "^16.3.2",
"@types/react": "^19.2.9",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.2",
"jsdom": "^27.4.0",
"typescript": "^5.9.3",
"vite": "^7.3.1"
"vite": "^7.3.1",
"vitest": "^4.0.17"
}
}