rm forwardRef

This commit is contained in:
Samuel Newman
2025-08-06 17:13:10 +03:00
parent d16ca5083f
commit 137e7e7848
+10 -5
View File
@@ -1,4 +1,3 @@
import {forwardRef} from 'react'
import {
type NativeSyntheticEvent,
type TextInput,
@@ -17,6 +16,7 @@ import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times'
import {IS_NATIVE} from '#/env'
type SearchInputProps = Omit<TextField.InputProps, 'label'> & {
ref?: React.Ref<TextInput>
label?: TextField.InputProps['label']
/**
* Called when the user presses the (X) button
@@ -28,8 +28,14 @@ type SearchInputProps = Omit<TextField.InputProps, 'label'> & {
onEscape?: () => void
}
export const SearchInput = forwardRef<TextInput, SearchInputProps>(
function SearchInput({value, label, onClearText, onEscape, ...rest}, ref) {
export function SearchInput({
ref,
value,
label,
onClearText,
onEscape,
...rest
}: SearchInputProps) {
const t = useTheme()
const {_} = useLingui()
const showClear = value && value.length > 0
@@ -97,5 +103,4 @@ export const SearchInput = forwardRef<TextInput, SearchInputProps>(
)}
</View>
)
},
)
}