diff --git a/packages/text-area/src/TextArea/TextArea.spec.tsx b/packages/text-area/src/TextArea/TextArea.spec.tsx
index 4f981577dc..1c37c9b0df 100644
--- a/packages/text-area/src/TextArea/TextArea.spec.tsx
+++ b/packages/text-area/src/TextArea/TextArea.spec.tsx
@@ -190,6 +190,11 @@ describe('packages/text-area', () => {
;
;
});
+
+ test('TextArea takes a ref for a HTMLTextAreaElement', () => {
+ const ref = React.createRef();
+ render();
+ });
});
/* eslint-enable jest/no-disabled-tests */
});
diff --git a/packages/text-input/src/TextInput/TextInput.spec.tsx b/packages/text-input/src/TextInput/TextInput.spec.tsx
index 09a219f840..4d1114bdbe 100644
--- a/packages/text-input/src/TextInput/TextInput.spec.tsx
+++ b/packages/text-input/src/TextInput/TextInput.spec.tsx
@@ -245,6 +245,11 @@ describe('packages/text-input', () => {
;
;
});
+
+ test('TextInput takes a ref for a HTMLInputElement', () => {
+ const ref = React.createRef();
+ render();
+ });
});
/* eslint-enable jest/no-disabled-tests */
});
diff --git a/packages/text-input/src/TextInput/TextInput.tsx b/packages/text-input/src/TextInput/TextInput.tsx
index 82b17e0cb1..082674d0e8 100644
--- a/packages/text-input/src/TextInput/TextInput.tsx
+++ b/packages/text-input/src/TextInput/TextInput.tsx
@@ -12,11 +12,12 @@ import { textInputStyle } from './TextInput.styles';
import {
SizeVariant,
State,
- TextInputComponentType,
TextInputProps,
TextInputType,
} from './TextInput.types';
+type TextInput = React.ForwardRefExoticComponent;
+
/**
*
* ```
@@ -39,7 +40,7 @@ import {
* @param props.sizeVariant determines the size of the text and the height of the input.
*/
-const TextInput = React.forwardRef(
+const TextInput: TextInput = React.forwardRef(
(
{
label,
@@ -182,7 +183,7 @@ const TextInput = React.forwardRef(
);
},
-) as TextInputComponentType;
+);
TextInput.displayName = 'TextInput';
diff --git a/packages/text-input/src/TextInput/TextInput.types.ts b/packages/text-input/src/TextInput/TextInput.types.ts
index 8f253a4539..7a011e8b08 100644
--- a/packages/text-input/src/TextInput/TextInput.types.ts
+++ b/packages/text-input/src/TextInput/TextInput.types.ts
@@ -70,7 +70,7 @@ interface TextInputTypeProp {
type?: TextInputType;
}
export interface BaseTextInputProps
- extends Omit, AriaLabels>,
+ extends Omit, AriaLabels>,
DarkModeProps,
LgIdProps {
/**
@@ -159,6 +159,3 @@ export type TextInputProps = Either<
BaseTextInputProps & AriaLabelProps & TextInputTypeProp,
AriaLabels
>;
-
-export type TextInputComponentType =
- React.ForwardRefExoticComponent;