mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-05 01:27:46 +07:00
added experimental scroll helper
This commit is contained in:
parent
c2154e930c
commit
8d1e6989c2
8 changed files with 105 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
import { useEffect, useState } from 'react';
|
||||
|
||||
export const useScrollTop = () => {
|
||||
const [top, setTop] = useState(0);
|
||||
const [top, setTop] = useState(typeof window !== 'undefined' ? window.scrollY : 0);
|
||||
|
||||
useEffect(() => {
|
||||
const onScroll = () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue