From 1fc64cca4002206423d1fa443ff2d60130ba1ea0 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Thu, 20 May 2021 14:44:20 +0100 Subject: [PATCH] Remove inputProps to rely on rest in TextInput --- packages/checkout/text-input/text-input.tsx | 10 +++------- .../checkout/text-input/validated-text-input.tsx | 15 +-------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/packages/checkout/text-input/text-input.tsx b/packages/checkout/text-input/text-input.tsx index edfe7ddc8d0..a20af9279c1 100644 --- a/packages/checkout/text-input/text-input.tsx +++ b/packages/checkout/text-input/text-input.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { forwardRef, HTMLProps, InputHTMLAttributes } from 'react'; +import { forwardRef, InputHTMLAttributes } from 'react'; import classnames from 'classnames'; import { useState } from '@wordpress/element'; @@ -26,10 +26,6 @@ interface TextInputProps autoComplete?: string; onChange: ( newValue: string ) => void; onBlur?: ( newValue: string ) => void; - inputProps?: Omit< - HTMLProps< HTMLInputElement >, - 'onChange' | 'onBlur' | 'ref' - >; } const TextInput = forwardRef< HTMLInputElement, TextInputProps >( @@ -53,7 +49,7 @@ const TextInput = forwardRef< HTMLInputElement, TextInputProps >( /* Do nothing */ }, feedback, - inputProps, + ...rest }, ref ) => { @@ -91,7 +87,7 @@ const TextInput = forwardRef< HTMLInputElement, TextInputProps >( : ariaDescribedBy } required={ required } - { ...inputProps } + { ...rest } />