From 94b89c274e6ac6b53bc8527f6bccd50b5fabf929 Mon Sep 17 00:00:00 2001 From: yunho1017 Date: Sun, 9 Jun 2024 11:58:40 +0900 Subject: [PATCH] fix: formItem help render type --- .../form/src/components/FormItem/index.tsx | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/packages/form/src/components/FormItem/index.tsx b/packages/form/src/components/FormItem/index.tsx index 34666bb37a38..0a93deee682a 100644 --- a/packages/form/src/components/FormItem/index.tsx +++ b/packages/form/src/components/FormItem/index.tsx @@ -170,7 +170,9 @@ type WarpFormItemProps = { * @param WarpFormItemProps * @returns */ -const WarpFormItem: React.FC = ({ +const WarpFormItem: React.FC< + Omit & WarpFormItemProps +> = ({ children, addonAfter, addonBefore, @@ -195,8 +197,35 @@ const WarpFormItem: React.FC = ({ return ( ( + <> + {doms.input} + {typeof help === 'function' + ? help({ + errors: inputProps.errors, + warnings: inputProps.warnings, + }) + : doms.errorList} + {doms.extra} + + ), + }} > {children} @@ -206,6 +235,7 @@ const WarpFormItem: React.FC = ({ return ( = ({
{addonAfter}
) : null} - {doms.extra} {typeof help === 'function' ? help({ errors: inputProps.errors, warnings: inputProps.warnings, }) : doms.errorList} + {doms.extra} ), }}