completionId: cgen-e4520bf613454ff6934d53e55a03230d
cgen-e4520bf613454ff6934d53e55a03230d
This commit is contained in:
parent
7f4bc4eb37
commit
5882acd51d
1 changed files with 3 additions and 3 deletions
|
|
@ -46,14 +46,14 @@ const getArmConfig = (
|
|||
};
|
||||
|
||||
export default function PageTransition({ children }: PageTransitionProps) {
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [visible, setVisible] = useState(true);
|
||||
const location = useLocation();
|
||||
const config = getArmConfig(location.pathname);
|
||||
|
||||
useEffect(() => {
|
||||
setVisible(false);
|
||||
const id = requestAnimationFrame(() => setVisible(true));
|
||||
return () => cancelAnimationFrame(id);
|
||||
const timer = setTimeout(() => setVisible(true), 800);
|
||||
return () => clearTimeout(timer);
|
||||
}, [location.pathname]);
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue