From 3b5b955bc2390696da82bdfaf64fa6e64a446348 Mon Sep 17 00:00:00 2001 From: Miroslav Petrik Date: Tue, 14 Mar 2023 12:47:32 +0100 Subject: [PATCH] fix: flowbite field atom id as field id --- src/field/FlowbiteField.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/field/FlowbiteField.tsx b/src/field/FlowbiteField.tsx index b782d3c..5c23e53 100644 --- a/src/field/FlowbiteField.tsx +++ b/src/field/FlowbiteField.tsx @@ -1,11 +1,11 @@ import { FieldProps, RequiredProps, - ValidatedFieldAtom, + ZodField, useRequiredProps, } from "@form-atoms/field"; import { Label } from "flowbite-react"; -import { ReactNode, useId } from "react"; +import { ReactNode } from "react"; import { RenderProp } from "react-render-prop-type"; import { FlowbiteStateColor, useFieldError } from "../hooks"; @@ -18,17 +18,17 @@ type Children = RenderProp< } >; -type FlowbiteFieldProps> = - FieldProps & Children; +type FlowbiteFieldProps> = FieldProps & + Children; -export const FlowbiteField = >({ +export const FlowbiteField = >({ field, required, label, children, ...uiProps }: FlowbiteFieldProps) => { - const id = useId(); + const id = `${field}`; const { color, error } = useFieldError(field); const { isFieldRequired, ...props } = useRequiredProps(field, required);