Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/components/ui/timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ interface TimelineEntry {

export const Timeline = ({ data }: { data: TimelineEntry[] }) => {
const ref = useRef<HTMLDivElement>(null);
// const containerRef = useRef<HTMLDivElement>(null);
// const containerRef = useRef<HTMLDivElement>(
// null!
// ) as React.RefObject<HTMLElement>;
const containerRef = useRef<HTMLDivElement>(null);

const [height, setHeight] = useState(0);
const [isSmallScreen, setIsSmallScreen] = useState(false);

Expand All @@ -37,8 +42,12 @@ export const Timeline = ({ data }: { data: TimelineEntry[] }) => {
}
}, [ref]);

// const { scrollYProgress } = useScroll({
// target: containerRef,
// offset: ["start 10%", "end 50%"]
// });
const { scrollYProgress } = useScroll({
target: containerRef,
target: containerRef as React.RefObject<HTMLElement>, // Ensure compatibility
offset: ["start 10%", "end 50%"]
});

Expand Down
3 changes: 2 additions & 1 deletion src/components/ui/tracing-beam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export const TracingBeam = ({
children: React.ReactNode;
className?: string;
}) => {
const ref = useRef<HTMLDivElement>(null);
// const ref = useRef<HTMLDivElement>(null);
const ref = useRef<HTMLDivElement>(null!) as React.RefObject<HTMLElement>;
const { scrollYProgress } = useScroll({
target: ref,
offset: ["start start", "end start"]
Expand Down