Skip to content

Commit

Permalink
feat: removed cleartimeout clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
taiwonaf committed Jul 25, 2024
1 parent 186ce2f commit 532ebbc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/hooks/use-window-width.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const useWindowWidth = () => {

useEffect(() => {
if (typeof window !== "undefined") {
const timeout = setTimeout(() => {
setTimeout(() => {
setWinWidth(window.innerWidth);
}, 500);

Expand All @@ -31,7 +31,6 @@ const useWindowWidth = () => {

window.addEventListener("resize", handleResize);
return () => {
clearTimeout(timeout);
window.removeEventListener("resize", handleResize);
};
}
Expand Down

0 comments on commit 532ebbc

Please sign in to comment.