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:
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user