Skip to content

[Flow] react-native FormDataPart type conflicts with built-in FormData types in flow #13187

Closed
@michaelgmcd

Description

@michaelgmcd

Description

The built-in type for FormData in flow requires that the second argument to the append method is a string, Blob, or File. This conflicts with the react-native FormDataPart type defined in
Libraries/Network/FormData.js:

type FormDataPart = {
  string: string,
  headers: Headers,
} | {
  uri: string,
  headers: Headers,
  name?: string,
  type?: string,
};

Flow built-in types:

Solution

I have made a similar issue in the flow repository (facebook/flow#3597).
I am not sure the approach to take here. I don't think we want to change the flow built-in type so it may require importing FormData directly from react-native or overwriting the type.

Additional Information

  • React Native version: 0.42.3
  • Platform: both
  • Development Operating System: MacOS
  • Dev tools: flow version 0.38.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions