From 3e2c181c404e2070873bc9c473b428a610bd193e Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 9 Sep 2025 18:09:10 +0300 Subject: Upgrade `@types/react` to 19 and run codemod (attempt 2) (#8918) * update dependencies * rm `import type React from 'react'` * run codemods * patch discord types * update types/react-dom * Update yarn.lock --- src/view/com/util/List.web.tsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/view/com/util/List.web.tsx') diff --git a/src/view/com/util/List.web.tsx b/src/view/com/util/List.web.tsx index 55dafb3dd..584738eea 100644 --- a/src/view/com/util/List.web.tsx +++ b/src/view/com/util/List.web.tsx @@ -1,4 +1,10 @@ -import React, {isValidElement, memo, startTransition, useRef} from 'react' +import React, { + isValidElement, + type JSX, + memo, + startTransition, + useRef, +} from 'react' import { type FlatListProps, StyleSheet, @@ -202,6 +208,7 @@ function ListImpl( behavior: animated ? 'smooth' : 'instant', }) }, + scrollToEnd({animated = true}: {animated?: boolean}) { const element = getScrollableNode() element?.scrollTo({ @@ -382,10 +389,10 @@ function EdgeVisibility({ containerRef, onVisibleChange, }: { - root?: React.RefObject | null + root?: React.RefObject | null topMargin?: string bottomMargin?: string - containerRef: React.RefObject + containerRef: React.RefObject onVisibleChange: (isVisible: boolean) => void }) { const [containerHeight, setContainerHeight] = React.useState(0) @@ -404,7 +411,7 @@ function EdgeVisibility({ } function useResizeObserver( - ref: React.RefObject, + ref: React.RefObject, onResize: undefined | ((w: number, h: number) => void), ) { const handleResize = useNonReactiveCallback(onResize ?? (() => {})) @@ -509,7 +516,7 @@ let Visibility = ({ onVisibleChange, style, }: { - root?: React.RefObject | null + root?: React.RefObject | null topMargin?: string bottomMargin?: string onVisibleChange: (isVisible: boolean) => void @@ -551,7 +558,7 @@ Visibility = React.memo(Visibility) export const List = memo(React.forwardRef(ListImpl)) as ( props: ListProps & {ref?: React.Ref}, -) => React.ReactElement +) => React.ReactElement // https://stackoverflow.com/questions/7944460/detect-safari-browser -- cgit 1.4.1