gpt4 book ai didi

reactjs - redux-form 中的 InjectedFormProps 是什么?

转载 作者:行者123 更新时间:2023-12-04 17:38:10 31 4
gpt4 key购买 nike

我正在研究使用 Redux Form 的 React-TypeScript 项目。

其中一个组件在类型定义中使用了 InjectedFormProps

const Container: React.SFC<Props & InjectedFormProps<{}, Props>> = (props: Props & InjectedFormProps<{}, Props>) => {


return <> </>;

}

谁能详细解释一下 InjectedFormProps 在幕后做了什么?

最佳答案

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/redux-form/v7/lib/reduxForm.d.ts

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 };
}

关于reactjs - redux-form 中的 InjectedFormProps 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55718990/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com