From 2172d7169ec2e565834c8ef82468c036a8da45e2 Mon Sep 17 00:00:00 2001 From: Maksim Sviridov Date: Wed, 12 Jul 2023 16:28:27 +0300 Subject: [PATCH] fix(ComboBox): returns generic type for component as type casting --- src/components/ComboBox.tsx | 6 +++++- src/components/FormMultiInput.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/ComboBox.tsx b/src/components/ComboBox.tsx index 44b47b77..db52949e 100644 --- a/src/components/ComboBox.tsx +++ b/src/components/ComboBox.tsx @@ -213,6 +213,10 @@ export function ComboBoxRenderFunction( ); } -export const ComboBox = forwardRef>(ComboBoxRenderFunction); +type CustomForwardRefResult = ( + props: React.PropsWithoutRef> & React.RefAttributes, +) => React.ReactElement; + +export const ComboBox = forwardRef(ComboBoxRenderFunction) as CustomForwardRefResult; export default ComboBox; diff --git a/src/components/FormMultiInput.tsx b/src/components/FormMultiInput.tsx index d7e7cf32..f6299670 100644 --- a/src/components/FormMultiInput.tsx +++ b/src/components/FormMultiInput.tsx @@ -55,7 +55,7 @@ const StyledInput = styled(Input)` min-width: 100px; `; -const StyledComboBox = styled(ComboBox)` +const StyledComboBox = styled(ComboBox)` margin-left: ${gapS}; `;