rm forwardRef
This commit is contained in:
@@ -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>
|
||||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user