Skip to content

Commit

Permalink
Added missing length value to FieldRenderProps
Browse files Browse the repository at this point in the history
  • Loading branch information
erikras committed May 24, 2019
1 parent 4bdbaf4 commit 89454a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/types.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ export type FieldInputProps = {
export type FieldRenderProps = {
input: FieldInputProps,
meta: {
// TODO: Make a diff of `FieldState` without all the functions
active?: boolean,
data?: Object,
dirty?: boolean,
dirtySinceLastSubmit?: boolean,
error?: any,
initial?: boolean,
initial?: any,
invalid?: boolean,
meta?: boolean,
length?: number,
modified?: boolean,
pristine?: boolean,
submitError?: any,
submitFailed?: boolean,
Expand Down
1 change: 1 addition & 0 deletions src/useField.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ const useField = (
error: otherState.error,
initial: otherState.initial,
invalid: otherState.invalid,
length: otherState.length,
modified: otherState.modified,
pristine: otherState.pristine,
submitError: otherState.submitError,
Expand Down
5 changes: 4 additions & 1 deletion typescript/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export interface ReactContext {
reactFinalForm: FormApi;
}

export type FieldMetaState = Omit<FieldState, 'blur' | 'change' | 'focus'>;
export type FieldMetaState = Omit<
FieldState,
'blur' | 'change' | 'focus' | 'name' | 'value'
>;

interface FieldInputProps<T extends HTMLElement> {
name: string;
Expand Down

0 comments on commit 89454a4

Please sign in to comment.