我在使用Redux表单的React-TypeScript项目中工作。
其中一个组件是在类型定义中使用InjectedFormProps。
const Container: React.SFC<Props & InjectedFormProps<{}, Props>> = (props: Props & InjectedFormProps<{}, Props>) => {
return <> </>;
}有人能详细解释一下InjectedFormProps在幕后做什么吗?
发布于 2019-04-17 11:49:49
export interface InjectedFormProps<FormData = {}, P = {}, ErrorType = string> {
anyTouched: boolean;
array: InjectedArrayProps;
asyncValidate(): void;
asyncValidating: string | boolean;
autofill(field: string, value: any): void;
blur(field: string, value: any): void;
change(field: string, value: any): void;
clearAsyncError(field: string): void;
destroy(): void;
dirty: boolean;
error: ErrorType;
form: string;
handleSubmit: SubmitHandler<FormData, P, ErrorType>;
initialize(data: Partial<FormData>): void;
initialized: boolean;
initialValues: Partial<FormData>;
invalid: boolean;
pristine: boolean;
reset(): void;
submitFailed: boolean;
submitSucceeded: boolean;
submitting: boolean;
touch(...field: string[]): void;
untouch(...field: string[]): void;
valid: boolean;
warning: any;
registeredFields: { [name: string]: RegisteredField };
}https://stackoverflow.com/questions/55718990
复制相似问题