Skip to content

Commit

Permalink
Make it easier for Flow (#4044)
Browse files Browse the repository at this point in the history
With a stateless functional component passed as `component`, Flow cannot decide which type in the union to use. If we use a more specific type like `ElementType`, Flow can now figure out which case we mean.
  • Loading branch information
drwlrsn authored and erikras committed May 31, 2018
1 parent 23b1fbd commit 58bdb48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FieldArrayProps.types.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react'

export type Props = {
name: string,
component: React.ComponentType<*> | Function,
component: React.ComponentType<*> | React.ElementType,
props?: Object,
rerenderOnEveryChange?: boolean,
validate?: (value: any, allValues: Object, props: Object) => ?any,
Expand Down

0 comments on commit 58bdb48

Please sign in to comment.