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/components/forms/InputGroup.tsx | 7 +++++-- src/components/forms/TextField.tsx | 4 ++-- src/components/forms/ToggleButton.tsx | 9 +++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src/components/forms') diff --git a/src/components/forms/InputGroup.tsx b/src/components/forms/InputGroup.tsx index 6908d4df8..aacdc60c7 100644 --- a/src/components/forms/InputGroup.tsx +++ b/src/components/forms/InputGroup.tsx @@ -23,9 +23,12 @@ export function InputGroup(props: React.PropsWithChildren<{}>) { {React.cloneElement(child, { // @ts-ignore style: [ + // @ts-ignore ...(Array.isArray(child.props?.style) - ? child.props.style - : [child.props.style || {}]), + ? // @ts-ignore + child.props.style + : // @ts-ignore + [child.props.style || {}]), { borderTopLeftRadius: i > 0 ? 0 : undefined, borderTopRightRadius: i > 0 ? 0 : undefined, diff --git a/src/components/forms/TextField.tsx b/src/components/forms/TextField.tsx index 3d4caa93b..85fb7c481 100644 --- a/src/components/forms/TextField.tsx +++ b/src/components/forms/TextField.tsx @@ -28,7 +28,7 @@ import {type Props as SVGIconProps} from '#/components/icons/common' import {Text} from '#/components/Typography' const Context = createContext<{ - inputRef: React.RefObject | null + inputRef: React.RefObject | null isInvalid: boolean hovered: boolean onHoverIn: () => void @@ -152,7 +152,7 @@ export type InputProps = Omit & { value?: string onChangeText?: (value: string) => void isInvalid?: boolean - inputRef?: React.RefObject | React.ForwardedRef + inputRef?: React.RefObject | React.ForwardedRef } export function createInput(Component: typeof TextInput) { diff --git a/src/components/forms/ToggleButton.tsx b/src/components/forms/ToggleButton.tsx index 8e08665fd..fab9414f5 100644 --- a/src/components/forms/ToggleButton.tsx +++ b/src/components/forms/ToggleButton.tsx @@ -1,5 +1,10 @@ import React from 'react' -import {AccessibilityProps, TextStyle, View, ViewStyle} from 'react-native' +import { + type AccessibilityProps, + type TextStyle, + View, + type ViewStyle, +} from 'react-native' import {atoms as a, native, useTheme} from '#/alf' import * as Toggle from '#/components/forms/Toggle' @@ -7,7 +12,7 @@ import {Text} from '#/components/Typography' type ItemProps = Omit & AccessibilityProps & { - children: React.ReactElement + children: React.ReactElement testID?: string } -- cgit 1.4.1