Skip to content

Commit

Permalink
fix: fix flow errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ej9x committed Sep 10, 2020
1 parent 697a261 commit 85a782f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/Radio/RadioItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import { RadioCircleTag, RadioTag, RadioWrapperTag, RadioCircleInnerTag, RadioTe


type EqualsFuncArgument = {
selectedValue?: string | number,
value: string | number,
selectedValue?: string | number | boolean,
value: string | number | boolean,
}

type RadioItemClonedProps = {
/** private cloned props */
name?: string,
/** private cloned props */
onChange?: (string | number, SyntheticInputEvent<HTMLInputElement>) => void,
onChange?: (string | number | boolean, SyntheticInputEvent<HTMLInputElement>) => void,
/** private cloned props */
selectedValue?: string | number,
/** then true when show error styles */
hasError?: boolean,
}

type RadioItemProps = {
children?: React$Node | ({ checked: boolean }) => React$Node,
children?: any,
/** text of the label */
label?: string,
/** radio value */
Expand Down Expand Up @@ -65,9 +65,11 @@ class RadioItem extends PureComponent<RadioItemProps & RadioItemClonedProps> {
<RadioTag modifiers={ rest } name={ name } tagName="input" type="radio" onChange={ this.onChange } checked={ checked } />
<Choose>
<When condition={ typeof children === 'function' }>
{ /* $FlowIgnore */ }
{ children({ checked }) }
</When>
<When condition={ !!children }>
{ /* $FlowIgnore */ }
{ children }
</When>
<Otherwise>
Expand Down

0 comments on commit 85a782f

Please sign in to comment.