Skip to content

Commit

Permalink
Add explanatory comment for omitting prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend committed Aug 2, 2021
1 parent 11956d9 commit fa1d387
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/components/src/input-control/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ export interface InputBaseProps extends BaseProps, FlexProps {

export interface InputControlProps
extends Omit< InputBaseProps, 'children' >,
/**
* The `prefix` prop in `PolymorphicComponentProps< InputFieldProps, 'input', false >` comes from the
* `HTMLInputAttributes` and clashes with the one from `InputBaseProps`. So we have to omit it from
* `PolymorphicComponentProps< InputFieldProps, 'input', false >` in order that `InputBaseProps[ 'prefix' ]`
* be the only prefix prop. Otherwise it tries to do a union of the two prefix properties and you end up
* with an unresolvable type.
*/
Omit<
PolymorphicComponentProps< InputFieldProps, 'input', false >,
'stateReducer' | 'prefix'
Expand Down

0 comments on commit fa1d387

Please sign in to comment.