Skip to content

Recent Mantine update requires UseForm values to be typed, is this intentional or a bug #7586

@mathesond2

Description

@mathesond2

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.17.1

What package has an issue?

@mantine/core

What framework do you use?

Vite

In which browsers you can reproduce the issue?

Not applicable – issue is not related to the browser

Describe the bug

Upon upgrading @mantine/form from 7.16.0 to 7.17.1, I get a series of TS errors in my terminal relating to validator functions that now appear to need to be typed, ex:

Existing implementation:

  const form = useForm({
    initialValues: {
      postalCode: currentAddress?.postalCode || '',
    },
    validate: {
      postalCode: (value) => validatePostalCode(value) ? null : 'Zip is required',
    },
  });

New error:
ERROR(TypeScript) Parameter 'value' implicitly has an 'any' type.

Now, I can and have typed all useForm hooks within my app accordingly to resolve these errors, but this seems odd that I now have to explicitly do this, when I didn't previously. Is this an intentional decision or a bug?

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs reproductionIssues without reproduction, closed within a week if the reproduction is not provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions