Skip to content

Commit a4a1483

Browse files
authored
Fixed flow FieldProps problem (#376)
1 parent a3e977e commit a4a1483

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Field.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as React from 'react'
33
import { fieldSubscriptionItems } from 'final-form'
44
import diffSubscription from './diffSubscription'
55
import type { FieldSubscription, FieldState } from 'final-form'
6-
import type { FieldProps as Props, FieldRenderProps } from './types'
6+
import type { FieldPropsWithForm as Props, FieldRenderProps } from './types'
77
import renderComponent from './renderComponent'
88
import isReactNative from './isReactNative'
99
import getValue from './getValue'

src/types.js.flow

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export type FormProps = {
7979
RenderableProps<FormRenderProps>
8080

8181
export type FieldProps = {
82-
reactFinalForm: FormApi,
8382
allowNull?: boolean,
8483
format?: (value: any, name: string) => any,
8584
formatOnBlur?: boolean,
@@ -94,6 +93,10 @@ export type FieldProps = {
9493
component?: React.ComponentType<*> | SupportedInputs
9594
}
9695

96+
export type FieldPropsWithForm = {
97+
reactFinalForm: FormApi
98+
} & FieldProps
99+
97100
export type FormSpyProps = {
98101
reactFinalForm: FormApi,
99102
onChange?: (formState: FormState) => void,

0 commit comments

Comments
 (0)