Skip to content

Commit 89454a4

Browse files
committed
Added missing length value to FieldRenderProps
1 parent 4bdbaf4 commit 89454a4

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/types.js.flow

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ export type FieldInputProps = {
2929
export type FieldRenderProps = {
3030
input: FieldInputProps,
3131
meta: {
32-
// TODO: Make a diff of `FieldState` without all the functions
3332
active?: boolean,
3433
data?: Object,
3534
dirty?: boolean,
3635
dirtySinceLastSubmit?: boolean,
3736
error?: any,
38-
initial?: boolean,
37+
initial?: any,
3938
invalid?: boolean,
40-
meta?: boolean,
39+
length?: number,
40+
modified?: boolean,
4141
pristine?: boolean,
4242
submitError?: any,
4343
submitFailed?: boolean,

src/useField.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ const useField = (
168168
error: otherState.error,
169169
initial: otherState.initial,
170170
invalid: otherState.invalid,
171+
length: otherState.length,
171172
modified: otherState.modified,
172173
pristine: otherState.pristine,
173174
submitError: otherState.submitError,

typescript/index.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ export interface ReactContext {
1717
reactFinalForm: FormApi;
1818
}
1919

20-
export type FieldMetaState = Omit<FieldState, 'blur' | 'change' | 'focus'>;
20+
export type FieldMetaState = Omit<
21+
FieldState,
22+
'blur' | 'change' | 'focus' | 'name' | 'value'
23+
>;
2124

2225
interface FieldInputProps<T extends HTMLElement> {
2326
name: string;

0 commit comments

Comments
 (0)