From fa1d38706a7feaf61e268abf9b1aae66fc52db25 Mon Sep 17 00:00:00 2001 From: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Date: Mon, 2 Aug 2021 06:57:53 -0700 Subject: [PATCH] Add explanatory comment for omitting prefix --- packages/components/src/input-control/types.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/components/src/input-control/types.ts b/packages/components/src/input-control/types.ts index 592a599b1f7aad..c81c54da57c471 100644 --- a/packages/components/src/input-control/types.ts +++ b/packages/components/src/input-control/types.ts @@ -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'