From ca3fc601f469425fd78719e9ba7a1930394892f5 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sun, 13 Aug 2023 00:10:40 +0100 Subject: [PATCH] fix: types error --- src/components/ui/Input.tsx | 10 +++++----- src/pages/index.tsx | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/ui/Input.tsx b/src/components/ui/Input.tsx index fe3ceb3..8db5c85 100644 --- a/src/components/ui/Input.tsx +++ b/src/components/ui/Input.tsx @@ -5,7 +5,7 @@ import { FieldLabel } from "./FieldLabel" type InputProps = { label?: string addon?: string - prefix?: JSX.Element + prefixEle?: JSX.Element isBlock?: boolean error?: string help?: React.ReactNode @@ -18,7 +18,7 @@ export const Input = forwardRef(function Input< { label, addon, - prefix, + prefixEle, className, isBlock, error, @@ -31,15 +31,15 @@ export const Input = forwardRef(function Input< : React.ForwardedRef, ) { const hasAddon = !!addon - const hasPrefix = !!prefix + const hasPrefix = !!prefixEle const Component = (multiline ? "textarea" : "input") as any return (
{label && }
- {prefix && ( - {prefix} + {prefixEle && ( + {prefixEle} )} } {...getInputProps({ - onKeyDown: (event) => { + onKeyDown: ((event) => { if (event.key === "Enter" && !items.length) { Router.push(`/${inputValue}`) } - }, + }) as React.KeyboardEventHandler, })} /> <>