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 --- .../Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx | 2 +- .../Post/Embed/VideoEmbed/VideoEmbedInner/VideoFallback.tsx | 1 - .../VideoEmbed/VideoEmbedInner/web-controls/ControlButton.tsx | 1 - .../Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx | 1 - .../VideoEmbed/VideoEmbedInner/web-controls/VideoControls.tsx | 10 +++++----- .../VideoEmbed/VideoEmbedInner/web-controls/VolumeControl.tsx | 1 - .../Embed/VideoEmbed/VideoEmbedInner/web-controls/utils.tsx | 2 +- 7 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src/components/Post/Embed/VideoEmbed/VideoEmbedInner') diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx index 266438c04..52449698c 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx @@ -139,7 +139,7 @@ function useHLS({ playlist: string setHasSubtitleTrack: (v: boolean) => void setError: (v: Error | null) => void - videoRef: React.RefObject + videoRef: React.RefObject setHlsLoading: (v: boolean) => void }) { const [Hls, setHls] = useState( diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoFallback.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoFallback.tsx index 37b44751d..095136944 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoFallback.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoFallback.tsx @@ -1,7 +1,6 @@ import {View} from 'react-native' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' -import type React from 'react' import {atoms as a, useTheme} from '#/alf' import {Button, ButtonText} from '#/components/Button' diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/ControlButton.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/ControlButton.tsx index 9b0c963ea..5178b9283 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/ControlButton.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/ControlButton.tsx @@ -1,5 +1,4 @@ import {type SvgProps} from 'react-native-svg' -import type React from 'react' import {PressableWithHover} from '#/view/com/util/PressableWithHover' import {atoms as a, useTheme, web} from '#/alf' diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx index e4814462f..39661adef 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx @@ -2,7 +2,6 @@ import {useCallback, useEffect, useRef, useState} from 'react' import {View} from 'react-native' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' -import type React from 'react' import {isFirefox, isTouchDevice} from '#/lib/browser' import {clamp} from '#/lib/numbers' diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VideoControls.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VideoControls.tsx index 7a54ef486..78b457ed6 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VideoControls.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VideoControls.tsx @@ -46,14 +46,14 @@ export function Controls({ hlsLoading, hasSubtitleTrack, }: { - videoRef: React.RefObject - hlsRef: React.RefObject + videoRef: React.RefObject + hlsRef: React.RefObject active: boolean setActive: () => void focused: boolean setFocused: (focused: boolean) => void onScreen: boolean - fullscreenRef: React.RefObject + fullscreenRef: React.RefObject hlsLoading: boolean hasSubtitleTrack: boolean }) { @@ -232,7 +232,7 @@ export function Controls({ }, [onSeek, videoRef]) const [showCursor, setShowCursor] = useState(true) - const cursorTimeoutRef = useRef>() + const cursorTimeoutRef = useRef>(undefined) const onPointerMoveEmptySpace = useCallback(() => { setShowCursor(true) if (cursorTimeoutRef.current) { @@ -264,7 +264,7 @@ export function Controls({ [hovered], ) - const timeoutRef = useRef>() + const timeoutRef = useRef>(undefined) const onHoverWithTimeout = useCallback(() => { onHover() diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VolumeControl.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VolumeControl.tsx index ec5f23fc0..4bb66e17a 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VolumeControl.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/VolumeControl.tsx @@ -3,7 +3,6 @@ import {View} from 'react-native' import Animated, {FadeIn, FadeOut} from 'react-native-reanimated' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' -import type React from 'react' import {isSafari, isTouchDevice} from '#/lib/browser' import {atoms as a} from '#/alf' diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/utils.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/utils.tsx index db5ae6ac3..c2ebdca51 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/utils.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/utils.tsx @@ -4,7 +4,7 @@ import {isSafari} from '#/lib/browser' import {logger} from '#/logger' import {useVideoVolumeState} from '#/components/Post/Embed/VideoEmbed/VideoVolumeContext' -export function useVideoElement(ref: RefObject) { +export function useVideoElement(ref: RefObject) { const [playing, setPlaying] = useState(false) const [muted, setMuted] = useState(true) const [currentTime, setCurrentTime] = useState(0) -- cgit 1.4.1