From b46be19a22697a991eedddace2f2a546eb871775 Mon Sep 17 00:00:00 2001 From: honzapatCZ Date: Mon, 31 Mar 2025 11:24:49 +0200 Subject: [PATCH] change props children in input --- Parts/Input.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Parts/Input.tsx b/Parts/Input.tsx index f006251..853c854 100644 --- a/Parts/Input.tsx +++ b/Parts/Input.tsx @@ -5,11 +5,11 @@ import { useField as useFormikField, useFormikContext, FieldHookConfig } from "f //const useFormikField = null; //const useFormikContext = ()=>{}; -export function useField(props){ +export function useField(props) { let getField = useFormikField; const context = useFormikContext(); - if(!context){ - getField = (propsOrFieldName: FieldHookConfig)=>{ + if (!context) { + getField = (propsOrFieldName: FieldHookConfig) => { return [props, null, null]; } } @@ -25,8 +25,9 @@ export default function Input( } ) { /*name, id*/ + let { children, ...otherProps } = props; - const [field, meta, helpers] = useField(props); + const [field, meta, helpers] = useField(otherProps); return (
@@ -43,7 +44,7 @@ export default function Input( {/*name={name || title} id={id || name || title}*/} @@ -69,7 +70,7 @@ export function TextArea({ @@ -100,12 +101,12 @@ export function TextArea({ export function CheckBox({ label, title, - + children, ...props }) { - const [field, meta, helpers] = useField(props); + const [field, meta, helpers] = useField(props); return (