(arr: T[])
| 4 | import { isMessageLink } from "@/features/messages/lib/messageLink"; |
| 5 | |
| 6 | export function useStableArray<T>(arr: T[]): T[] { |
| 7 | const ref = React.useRef(arr); |
| 8 | if ( |
| 9 | arr.length !== ref.current.length || |
| 10 | arr.some((item, i) => item !== ref.current[i]) |
| 11 | ) { |
| 12 | ref.current = arr; |
| 13 | } |
| 14 | return ref.current; |
| 15 | } |
| 16 | |
| 17 | export function aspectRatioFromDim(dim?: string): number | undefined { |
| 18 | if (!dim) return undefined; |