auto-form
auto-form copied to clipboard
@autoform/react should be a peerDependencies of @autoform/mui, instead of dependencies
When I need to use buildZodFieldConfig:
import { z } from 'zod';
import { buildZodFieldConfig } from '@autoform/react';
import { FieldTypes } from '@autoform/mui';
const fieldConfig = buildZodFieldConfig<
FieldTypes,
{
// You can define custom props here
isImportant?: boolean;
}
>();
I need to import it from @autoform/react. But it is auto-installed as a dependencies of @autoform/mui. I cannot import it in my project (I am using pnpm which strictly preventing phantom dependency). For some reason I cannot config public-hoist-pattern of pnpm (team regulation to prevent phantom dependency).
So I have to install @autoform/react in my project, which may causing duplicate @autoform/react packages in the node_modules tree.
After more digging, I think buildZodFieldConfig from '@autoform/react' is deprecated. We should use import { fieldConfig } from '@autoform/zod' now.
There are some doc still referring buildZodFieldConfig currently.