From 36b52aaa4d1f83cfc189d5f6f34b251eb5177066 Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Sun, 25 May 2025 00:09:16 -0500 Subject: [PATCH] fix: Ref types ahead of v11 making them stricter --- src/view/components/elements/VirtualizedList.tsx | 2 +- src/view/components/elements/useAutoIndent.ts | 5 ++++- .../profiler/components/CommitTimeline/CommitTimeline.tsx | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/view/components/elements/VirtualizedList.tsx b/src/view/components/elements/VirtualizedList.tsx index 468a1abe..140730ee 100644 --- a/src/view/components/elements/VirtualizedList.tsx +++ b/src/view/components/elements/VirtualizedList.tsx @@ -10,7 +10,7 @@ import { useResize } from "../utils"; export interface VirtualizedListProps { items: T[]; - container: RefObject; + container: RefObject; rowHeight: number; minBufferCount: number; renderRow: (item: T, idx: number, top: number) => any; diff --git a/src/view/components/elements/useAutoIndent.ts b/src/view/components/elements/useAutoIndent.ts index b21ca957..a145fa96 100644 --- a/src/view/components/elements/useAutoIndent.ts +++ b/src/view/components/elements/useAutoIndent.ts @@ -5,7 +5,10 @@ import { useResize } from "../utils"; const INITIAL = 14; const RIGHT_MARGIN = 16; -export function useAutoIndent(container: RefObject, deps: any[]) { +export function useAutoIndent( + container: RefObject, + deps: any[], +) { const indent = useRef(INITIAL); const [available, setAvailable] = useState(0); const cacheRef = useRef(new Map()); diff --git a/src/view/components/profiler/components/CommitTimeline/CommitTimeline.tsx b/src/view/components/profiler/components/CommitTimeline/CommitTimeline.tsx index a1bc2162..f08d016d 100644 --- a/src/view/components/profiler/components/CommitTimeline/CommitTimeline.tsx +++ b/src/view/components/profiler/components/CommitTimeline/CommitTimeline.tsx @@ -5,10 +5,10 @@ import { useResize } from "../../../utils"; import { Icon } from "../../../icons"; function calcSize( - container: RefObject, - inner: RefObject, - pane: RefObject, - paneContainer: RefObject, + container: RefObject, + inner: RefObject, + pane: RefObject, + paneContainer: RefObject, count: number, selected: number, ) {