Files
blitzkit/packages/website/src/hooks/useStableProgress.ts
T
2025-09-13 23:42:26 -05:00

15 lines
327 B
TypeScript

import { useProgress } from "@react-three/drei";
import { useRef } from "react";
export function useStableProgress() {
const { loaded, total } = useProgress();
const progress = useRef(0);
progress.current = Math.max(
progress.current,
total === 0 ? 0 : (loaded / total) * 100
);
return progress.current;
}