mirror of
https://github.com/p-stream/p-stream.git
synced 2026-08-14 03:18:28 +00:00
Fix ref
This commit is contained in:
parent
7c588744ef
commit
b312405285
1 changed files with 2 additions and 2 deletions
|
|
@ -22,7 +22,7 @@ function ThumbnailDisplay(props: { at: number; show: boolean }) {
|
|||
offscreenLeft: 0,
|
||||
offscreenRight: 0,
|
||||
});
|
||||
const ref = useRef<HTMLImageElement>(null);
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!ref.current) return;
|
||||
|
|
@ -50,7 +50,7 @@ function ThumbnailDisplay(props: { at: number; show: boolean }) {
|
|||
return (
|
||||
<div className="flex flex-col items-center -translate-x-1/2 pointer-events-none">
|
||||
<div className="w-screen flex justify-center">
|
||||
<div ref={ref as unknown as React.RefObject<HTMLDivElement>}>
|
||||
<div ref={ref}>
|
||||
<div
|
||||
style={{
|
||||
transform: `translateX(${transformX}px)`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue