@ant-design/react-native
Version:
基于蚂蚁金服移动设计规范的 React Native 组件库
41 lines (40 loc) • 1.57 kB
TypeScript
import React from 'react';
import { NativeSyntheticEvent, StyleProp, TextInput, TextInputFocusEventData, TextInputProps, TextStyle } from 'react-native';
import { WithThemeStyles } from '../style';
import { SearchBarPropsType, SearchBarState } from './PropsType';
import { SearchBarStyle } from './style/index';
export interface SearchBarProps extends SearchBarPropsType, WithThemeStyles<SearchBarStyle>, Omit<TextInputProps, 'onChange'> {
onChangeText?: (text: string) => void;
onSubmitEditing?: (event: {
nativeEvent: {
text: string;
};
}) => void;
style?: StyleProp<TextStyle>;
}
export default class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
static defaultProps: {
placeholder: string;
onSubmit: () => void;
onChange: () => void;
onFocus: () => void;
onBlur: () => void;
onClear: () => void;
showCancelButton: boolean;
disabled: boolean;
};
static contextType: React.Context<import("../locale-provider").LocaleContextProps | undefined>;
inputRef: TextInput | null;
constructor(props: SearchBarProps);
UNSAFE_componentWillReceiveProps(nextProps: SearchBarProps): void;
onSubmit: (_: {
nativeEvent: {
text: string;
};
}) => void;
onChangeText: (value: string) => void;
onCancel: () => void;
onFocus: (e: NativeSyntheticEvent<TextInputFocusEventData>) => void;
onBlur: (e: NativeSyntheticEvent<TextInputFocusEventData>) => void;
render(): React.JSX.Element;
}