mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
[redux-form] add v8 typings
This commit is contained in:
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for redux-form 7.5
|
||||
// Type definitions for redux-form 8.1
|
||||
// Project: https://github.com/erikras/redux-form, https://redux-form.com
|
||||
// Definitions by: Carson Full <https://github.com/carsonf>
|
||||
// Daniel Lytkin <https://github.com/aikoven>
|
||||
|
||||
Vendored
+1
-1
@@ -44,7 +44,7 @@ export interface BaseFieldProps<P = {}> extends Partial<CommonFieldProps> {
|
||||
parse?: Parser;
|
||||
validate?: Validator | Validator[];
|
||||
warn?: Validator | Validator[];
|
||||
withRef?: boolean;
|
||||
forwardRef?: boolean;
|
||||
immutableProps?: string[];
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -6,7 +6,7 @@ export interface BaseFieldArrayProps<P = {}> {
|
||||
component: ComponentType<P>;
|
||||
validate?: Validator | Validator[];
|
||||
warn?: Validator | Validator[];
|
||||
withRef?: boolean;
|
||||
forwardRef?: boolean;
|
||||
props?: P;
|
||||
rerenderOnEveryChange?: boolean;
|
||||
}
|
||||
|
||||
Vendored
+9
-2
@@ -1,5 +1,10 @@
|
||||
import { Component, ComponentType } from "react";
|
||||
import { Formatter, Parser, WrappedFieldProps } from "../index";
|
||||
import { Formatter, Parser, WrappedFieldProps, Validator } from "../index";
|
||||
|
||||
export type FieldsWarnerOrValidator =
|
||||
| Validator
|
||||
| Validator[]
|
||||
| { [name: string]: Validator | Validator[] };
|
||||
|
||||
interface BaseFieldsProps<P = {}> {
|
||||
names: string[];
|
||||
@@ -7,7 +12,9 @@ interface BaseFieldsProps<P = {}> {
|
||||
format?: Formatter | null;
|
||||
props?: P;
|
||||
parse?: Parser;
|
||||
withRef?: boolean;
|
||||
forwardRef?: boolean;
|
||||
validate?: FieldsWarnerOrValidator;
|
||||
warn?: FieldsWarnerOrValidator;
|
||||
}
|
||||
|
||||
export interface GenericFields<P> extends Component<BaseFieldsProps<P> & P> {
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { ReactNode, StatelessComponent } from "react";
|
||||
|
||||
export interface FormNameProps {
|
||||
children: (props: { form: string }) => ReactNode;
|
||||
children: (props: { form: string, sectionPrefix?: string }) => ReactNode;
|
||||
}
|
||||
|
||||
export const FormName: StatelessComponent<FormNameProps>;
|
||||
|
||||
@@ -422,7 +422,11 @@ class FormNameTest extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<FormName>
|
||||
{({ form }) => <span>Form Name is: {form}</span>}
|
||||
{({ form, sectionPrefix }) => (
|
||||
<span>
|
||||
Form name is {form} and section prefix is {sectionPrefix}
|
||||
</span>
|
||||
)}
|
||||
</FormName>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user