Skip to content

BUG: REACT HOOK FORM register type max input is a number ERROR #4566

@VigilioYonatan

Description

@VigilioYonatan
  • [x ] Check if updating to the latest Preact version resolves the issue

Describe the bug
React hook form method register have a type max input like number and input preact is Signalish<string | undefined> .

import { useForm } from "react-hook-form";

export function App() {
    const { register } = useForm<{ name: string }>();
    return (
        <>
            <input type="text" {...register("name")} />
        </>
    );
}

To Reproduce
https://codesandbox.io/p/sandbox/error-input-react-hook-form-y8rprh

Steps to reproduce the behavior:

  1. example but no show error, but in vite js it happen
  2. npm init vite@latest app
  3. choose preact typescript and install dependencies.
  4. install react hook form

SOLUTION
Expected behavior
the solution is that min and max add number
min?: Signalish<string | undefined|number>;
MAX?: Signalish<string | undefined|number>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions