Skip to content

Commit

Permalink
fix: improve use of refs in dependency lists (#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
wardoost authored Oct 12, 2019
1 parent d4aec7a commit ed8e26d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/useFullscreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const useFullscreen = (ref: RefObject<Element>, on: boolean, options: FullScreen
video.current.webkitExitFullscreen();
}
};
}, [ref.current, video, on]);
}, [on, video, ref]);

return isFullscreen;
};
Expand Down
2 changes: 1 addition & 1 deletion src/useMouse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const useMouse = (ref: RefObject<Element>): State => {
cancelAnimationFrame(frame.current);
document.removeEventListener('mousemove', moveHandler);
};
}, [ref.current]);
}, [ref]);

return state;
};
Expand Down
2 changes: 1 addition & 1 deletion src/useScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const useScroll = (ref: RefObject<HTMLElement>): State => {
ref.current.removeEventListener('scroll', handler);
}
};
}, [ref.current]);
}, [ref]);

return state;
};
Expand Down
2 changes: 1 addition & 1 deletion src/useScrolling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const useScrolling = (ref: RefObject<HTMLElement>): boolean => {
};
}
return () => {};
}, [ref.current]);
}, [ref]);

return scrolling;
};
Expand Down

0 comments on commit ed8e26d

Please sign in to comment.