diff --git a/examples/multi-tenant-single-domain/src/fields/TenantField/components/Field.client.tsx b/examples/multi-tenant-single-domain/src/fields/TenantField/components/Field.client.tsx index 3313f6c9c6..7e49b59205 100644 --- a/examples/multi-tenant-single-domain/src/fields/TenantField/components/Field.client.tsx +++ b/examples/multi-tenant-single-domain/src/fields/TenantField/components/Field.client.tsx @@ -8,15 +8,15 @@ type Props = { readOnly: boolean } export function TenantFieldComponentClient({ initialValue, path, readOnly }: Props) { - const { formInitializing, setValue } = useField({ path }) + const { formInitializing, setValue, value } = useField({ path }) const hasSetInitialValue = React.useRef(false) React.useEffect(() => { - if (!hasSetInitialValue.current && !formInitializing && initialValue) { + if (!hasSetInitialValue.current && !formInitializing && initialValue && !value) { setValue(initialValue) hasSetInitialValue.current = true } - }, [initialValue, setValue, formInitializing]) + }, [initialValue, setValue, formInitializing, value]) return (