File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,12 @@ interface TimelineEntry {
1515
1616export const Timeline = ( { data } : { data : TimelineEntry [ ] } ) => {
1717 const ref = useRef < HTMLDivElement > ( null ) ;
18+ // const containerRef = useRef<HTMLDivElement>(null);
19+ // const containerRef = useRef<HTMLDivElement>(
20+ // null!
21+ // ) as React.RefObject<HTMLElement>;
1822 const containerRef = useRef < HTMLDivElement > ( null ) ;
23+
1924 const [ height , setHeight ] = useState ( 0 ) ;
2025 const [ isSmallScreen , setIsSmallScreen ] = useState ( false ) ;
2126
@@ -37,8 +42,12 @@ export const Timeline = ({ data }: { data: TimelineEntry[] }) => {
3742 }
3843 } , [ ref ] ) ;
3944
45+ // const { scrollYProgress } = useScroll({
46+ // target: containerRef,
47+ // offset: ["start 10%", "end 50%"]
48+ // });
4049 const { scrollYProgress } = useScroll ( {
41- target : containerRef ,
50+ target : containerRef as React . RefObject < HTMLElement > , // Ensure compatibility
4251 offset : [ "start 10%" , "end 50%" ]
4352 } ) ;
4453
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ export const TracingBeam = ({
1616 children : React . ReactNode ;
1717 className ?: string ;
1818} ) => {
19- const ref = useRef < HTMLDivElement > ( null ) ;
19+ // const ref = useRef<HTMLDivElement>(null);
20+ const ref = useRef < HTMLDivElement > ( null ! ) as React . RefObject < HTMLElement > ;
2021 const { scrollYProgress } = useScroll ( {
2122 target : ref ,
2223 offset : [ "start start" , "end start" ]
You can’t perform that action at this time.
0 commit comments