Skip to content

Commit

Permalink
index.js.flow: Export FormProps we pass *to* components
Browse files Browse the repository at this point in the history
Documentation states that 'FormProps' is what's passed *to* a component
wrapped with reduxForm(); however, what was exported here was the props
that should be passed *by* a user *to* the <Form> component.

Switched to using the same naming convention as is already used for
other prop-types with the same potential for confusion: exported
'FieldProps' for the props Field passes to user components, and
non-exported FieldInputProps for the props Field expects to get from its
callers.

Fixes redux-form#3823.
  • Loading branch information
asazernik committed Feb 8, 2019
1 parent 54d2829 commit ac07ce3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/index.js.flow
Expand Up @@ -6,7 +6,7 @@ import type { Params as DefaultShouldValidateParams } from './defaultShouldValid
import type { Params as DefaultShouldErrorParams } from './defaultShouldError'
import type { Params as DefaultShouldWarnParams } from './defaultShouldWarn'
import type { Config as ReduxFormConfig } from './createReduxForm'
import type { Props as _FormProps } from './Form'
import type { Props as FormInputProps } from './Form'
import type { Props as _FormNameProps } from './FormName'
import type {
DefaultProps as FormSectionDefaultProps,
Expand Down Expand Up @@ -73,11 +73,10 @@ import type {
Untouch
} from './actions.types'

export type { Event } from './types'
export type { Event, FormProps } from './types'

type StructureMap = Object

export type FormProps = _FormProps
export type FormNameProps = _FormNameProps
export type { FieldProps } from './FieldProps.types'
export type { FieldArrayProps } from './FieldArrayProps.types'
Expand Down Expand Up @@ -124,7 +123,7 @@ declare export var Fields: ComponentType<FieldsInputProps>

declare export var FieldArray: ComponentType<FieldArrayInputProps>

declare export var Form: ComponentType<FormProps>
declare export var Form: ComponentType<FormInputProps>

declare export var FormSection: ComponentType<FormSectionProps>

Expand Down

0 comments on commit ac07ce3

Please sign in to comment.