Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Flow typings for UseFieldConfig and FieldProps #503

Merged
merged 1 commit into from
May 29, 2019
Merged

Fix Flow typings for UseFieldConfig and FieldProps #503

merged 1 commit into from
May 29, 2019

Conversation

eugene-stativka
Copy link
Contributor

There was a mismatch between the source code and Flow typings which led to the following error:

<Field
  name={name}
  component={SomeCustomInputComponent}
  /* ^^^ Flow error here:
  Cannot create Field element because in property component:
   • Either function [1] is incompatible with string literal
     input [2].
   • Or function [1] is incompatible with string literal
     select [3].
   • Or function [1] is incompatible with string literal
     textarea [4].
  */
/>

There was a mismatch between the source code and Flow typings which led to the following error:
```js
<Field
  name={name}
  component={SomeCustomInputComponent}
  /* ^^^ Flow error here:
  Cannot create Field element because in property component:
   • Either function [1] is incompatible with string literal
     input [2].
   • Or function [1] is incompatible with string literal
     select [3].
   • Or function [1] is incompatible with string literal
     textarea [4].
  */
```
@codecov
Copy link

codecov bot commented May 28, 2019

Codecov Report

Merging #503 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #503   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          14     14           
  Lines         231    231           
  Branches       57     57           
=====================================
  Hits          231    231

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13008e3...4629353. Read the comment docs.

@erikras
Copy link
Member

erikras commented May 28, 2019

I feel like ignoring SupportedInputs is a mistake. Seems like an important shortlist of valid strings.

@eugene-stativka
Copy link
Contributor Author

I feel like ignoring SupportedInputs is a mistake. Seems like an important shortlist of valid strings.

I am not sure I understood where SupportedInputs are ignored.

component?: $PropertyType<RenderableProps<*>, 'component'>, 
// ^^^ this is the same as:
component?: React.ComponentType<*> | SupportedInputs

Please clarify.

@erikras
Copy link
Member

erikras commented May 29, 2019

Oh, shit. I didn't know you could do that. 👍

@erikras erikras merged commit 54e90c0 into final-form:master May 29, 2019
@erikras
Copy link
Member

erikras commented May 29, 2019

Published in v6.0.1.

@lock
Copy link

lock bot commented Jun 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants