Skip to content

Commit

Permalink
fix: change type to fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn authored Sep 8, 2021
1 parent 659fb8e commit c272338
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ interface ChoiceFieldProps extends Omit<FieldIdentifier, 'initValue'> {
options: Options
initValue?: Option
onRenderPopover: (
selection: Option,
selection: Option | undefined,
options: Options,
select: (option: Option) => void
) => JSX.Element
onRender: (selection: Option) => JSX.Element
onRender: (selection: Option | undefined) => JSX.Element
}

// Component
Expand Down Expand Up @@ -63,7 +63,7 @@ const ChoiceField: React.FC<ChoiceFieldProps> = ({

const isRegistered = updatedValue !== undefined

const selection = isRegistered
const selection: string | undefined = isRegistered
? updatedValue
: contextValue || initValue || options[0]

Expand Down

0 comments on commit c272338

Please sign in to comment.