diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/products/page-client-list-view.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/products/page-client-list-view.tsx index 805756bce..2c2100694 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/products/page-client-list-view.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/products/page-client-list-view.tsx @@ -79,7 +79,7 @@ type ListItemProps = { onMouseLeave?: () => void, isEven?: boolean, isHighlighted?: boolean, - itemRef?: React.RefObject, + itemRef?: React.RefObject, actionItems?: ActionMenuItem[], }; @@ -180,9 +180,9 @@ function ListGroup({ title, children }: ListGroupProps) { // Connection line component type ConnectionLineProps = { - fromRef: React.RefObject, - toRef: React.RefObject, - containerRef: React.RefObject, + fromRef: React.RefObject, + toRef: React.RefObject, + containerRef: React.RefObject, quantity?: number, }; @@ -320,7 +320,7 @@ type ProductsListProps = { paymentsGroups: any, hoveredItemId: string | null, getConnectedProducts: (itemId: string) => string[], - productRefs?: Record>, + productRefs?: Record>, onProductMouseEnter: (productId: string) => void, onProductMouseLeave: () => void, onProductAdd?: () => void, @@ -470,7 +470,7 @@ type ItemsListProps = { items: CompleteConfig['payments']['items'], hoveredProductId: string | null, getConnectedItems: (productId: string) => string[], - itemRefs?: Record>, + itemRefs?: Record>, onItemMouseEnter: (itemId: string) => void, onItemMouseLeave: () => void, onItemAdd?: () => void, diff --git a/apps/dashboard/src/components/data-table/common/stable-value.tsx b/apps/dashboard/src/components/data-table/common/stable-value.tsx index ef949c5aa..b552367e4 100644 --- a/apps/dashboard/src/components/data-table/common/stable-value.tsx +++ b/apps/dashboard/src/components/data-table/common/stable-value.tsx @@ -3,8 +3,8 @@ import { useRef } from "react"; export function useStableValue(value: T, fingerprint: string): T { - const previousRef = useRef<{ fingerprint: string, value: T }>(); - if (previousRef.current && previousRef.current.fingerprint === fingerprint) { + const previousRef = useRef<{ fingerprint: string, value: T } | null>(null); + if (previousRef.current != null && previousRef.current.fingerprint === fingerprint) { return previousRef.current.value; } previousRef.current = { fingerprint, value }; diff --git a/apps/dashboard/src/components/stack-companion/changelog-widget.tsx b/apps/dashboard/src/components/stack-companion/changelog-widget.tsx index 0b5dff3d5..865ada9ac 100644 --- a/apps/dashboard/src/components/stack-companion/changelog-widget.tsx +++ b/apps/dashboard/src/components/stack-companion/changelog-widget.tsx @@ -6,7 +6,7 @@ import { CalendarIcon, CaretDownIcon, CaretUpIcon, InfoIcon, XIcon } from '@phos import { captureError } from '@hexclave/shared/dist/utils/errors'; import { runAsynchronously } from '@hexclave/shared/dist/utils/promises'; import Image from 'next/image'; -import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { useCallback, useEffect, useMemo, useRef, useState, type ComponentPropsWithoutRef } from 'react'; import { createPortal } from 'react-dom'; import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; @@ -101,8 +101,8 @@ export function ChangelogWidget({ isActive, initialData }: ChangelogWidgetProps) ), - img: ({ src, alt }: { src?: string, alt?: string }) => { - if (!src) return null; + img: ({ src, alt }: ComponentPropsWithoutRef<'img'>) => { + if (typeof src !== 'string') return null; return (