Skip to content

Commit

Permalink
fix: Fix flow types not being correctly removed from compiled code
Browse files Browse the repository at this point in the history
Unfortunately @babel/plugin-transform-flow-comments is not correctly
transforming the Flow %checks option. This removes %checks and
tells flow to ignore the code for now.
  • Loading branch information
gmaclennan committed Jul 16, 2020
1 parent 1d38186 commit cc2cfb5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ObservationDialog/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function Encoder(options: Array<LabeledSelectOption>) {

function isSelectableFieldValue(
v: SelectableFieldValue | LabeledSelectOption
): boolean %checks {
): boolean {
return (
typeof v === 'string' ||
typeof v === 'boolean' ||
Expand All @@ -103,8 +103,10 @@ function getLabeledSelectOptions(
): Array<LabeledSelectOption> {
return options.map(opt =>
isSelectableFieldValue(opt)
? { label: primitiveToString(opt), value: opt }
: opt
? // $FlowFixMe
{ label: primitiveToString(opt), value: opt }
: // $FlowFixMe
opt
)
}

Expand Down

0 comments on commit cc2cfb5

Please sign in to comment.