Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'name' does not exist in type 'FormFieldProps & VNodeProps & AllowedComponentProps & ComponentCustomProps'. #7250

Open
1 of 4 tasks
davidjmstewart opened this issue Feb 13, 2025 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@davidjmstewart
Copy link

davidjmstewart commented Feb 13, 2025

Describe the bug

My @primevue/forms types are missing a name property for the FormField component. This looks like it was addressed in commit a7679da

My package version in package.json is: @primevue/forms": "^4.2.5

/**
 * Defines valid properties in Form component.
 */
export interface FormFieldProps {
    /**
     * A function that resolves validation logic.
     * @param {FormResolverOptions} e - Resolver options
     */
    resolver?: (e: FormFieldResolverOptions) => any | undefined;
    /**
     * The initial value for the form field.
     */
    initialValue?: any;
    /**
     * Whether to validate the form field when the value change.
     */
    validateOnValueUpdate?: boolean | undefined;
    /**
     * Whether to validate the form field when it loses focus (on blur).
     */
    validateOnBlur?: boolean | undefined;
    /**
     * Whether to validate the form field immediately after the form is mounted.
     */
    validateOnMount?: boolean | undefined;
    /**
     * Whether to validate the form field when the form is submitted.
     */
    validateOnSubmit?: boolean | undefined;
    /**
     * Use to change the HTML tag of root element.
     * @defaultValue DIV
     */
    as?: string | Component | undefined;
    /**
     * When enabled, it changes the default rendered element for the one passed as a child element.
     * @defaultValue false
     */
    asChild?: boolean | undefined;
    /**
     * It generates scoped CSS variables using design tokens for the component.
     */
    dt?: DesignToken<any>;
    /**
     * Used to pass attributes to DOM elements inside the component.
     * @type {FormPassThroughOptions}
     */
    pt?: PassThrough<FormFieldPassThroughOptions>;
    /**
     * Used to configure passthrough(pt) options of the component.
     * @type {PassThroughOptions}
     */
    ptOptions?: PassThroughOptions;
    /**
     * When enabled, it removes component related styles in the core.
     * @defaultValue false
     */
    unstyled?: boolean;
}

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

There is already a commit that should fix this, it appears that it hasn't been published to the npm registry.

See commit here: a7679da

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template?file=README.md

Environment

I don't see a TypeScript template so i'm linking a blank template.

Vue version

3.5.11

PrimeVue version

4.2.5

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

Try adding the name prop to a FormField in a TypeScript application.

You will see the error Object literal may only specify known properties, and 'name' does not exist in type 'FormFieldProps & VNodeProps & AllowedComponentProps & ComponentCustomProps'.

Expected behavior

No TypeScript compiler errors.

@davidjmstewart davidjmstewart added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant