From c89401357d9818997e9ebdb7e2797589d17037dc Mon Sep 17 00:00:00 2001 From: Viraj Ajay Joshi Date: Wed, 3 Apr 2024 14:42:59 +0530 Subject: [PATCH] fix: textarea component --- .../src/core-components/nativewind/switch/index.tsx | 2 +- .../src/core-components/nativewind/textarea/index.tsx | 11 ++++++++--- example/storybook-nativewind/tsconfig.json | 1 + packages/unstyled/textarea/src/types.ts | 4 +++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/example/storybook-nativewind/src/core-components/nativewind/switch/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/switch/index.tsx index 86c2024fa5..59aa185df9 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/switch/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/switch/index.tsx @@ -34,7 +34,7 @@ type ISwitchProps = React.ComponentProps & const Switch = React.forwardRef( ( { className, size = 'md', ...props }: { className?: string } & ISwitchProps, - ref + ref?: any ) => { return ( { return ( & const TextareaInput = React.forwardRef( ( { className, ...props }: { className?: string } & ITextareaInputProps, - ref + ref?: any ) => { const { size: parentSize } = useStyleContext(SCOPE); diff --git a/example/storybook-nativewind/tsconfig.json b/example/storybook-nativewind/tsconfig.json index 5d17482b70..b4d887d14f 100644 --- a/example/storybook-nativewind/tsconfig.json +++ b/example/storybook-nativewind/tsconfig.json @@ -13,6 +13,7 @@ "../../packages/unstyled/alert-dialog/src" ], "@gluestack-ui/menu": ["../../packages/unstyled/menu/src"], + "@gluestack-ui/textarea": ["../../packages/unstyled/textarea/src"], "@gluestack-ui/link": ["../../packages/unstyled/link/src"], "@gluestack-ui/nativewind-utils/tva": [ "../../packages/nativewind/utils/src/tva" diff --git a/packages/unstyled/textarea/src/types.ts b/packages/unstyled/textarea/src/types.ts index 035f75049e..7a0408336d 100644 --- a/packages/unstyled/textarea/src/types.ts +++ b/packages/unstyled/textarea/src/types.ts @@ -43,5 +43,7 @@ export interface IInputProps { export type ITextareaComponentType = React.ForwardRefExoticComponent & { - Input: React.ForwardRefExoticComponent; + Input: React.ForwardRefExoticComponent< + Input & React.RefAttributes & IInputProps + >; };