Skip to content

Commit

Permalink
hook return type
Browse files Browse the repository at this point in the history
  • Loading branch information
kingRayhan authored Dec 23, 2023
1 parent bdb62a8 commit f68e594
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/useVisibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ interface useOnScreenInterface {
options?: IntersectionObserverInit;
}

const useVisibility = (args: useOnScreenInterface) => {
interface useVisibilityReturnType {
ref: React.MutableRefObject<any>;
visible: Boolean;
}

const useVisibility = (args: useOnScreenInterface): useVisibilityReturnType => {
const ref = useRef();
const [visible, setVisible] = useState<Boolean>(false);

Expand Down

0 comments on commit f68e594

Please sign in to comment.