score:16

Accepted answer

It appears to be a common issue, and has been raised multiple times in the linked github issues section. There is no full code example that is provided, so posting my own solution here, just in case, another book reader is stumped like me.

  <form onSubmit={handleSubmit}>
    <input
      {...register("search")} defaultValue={criteria}
      placeholder="type here"
      type="text"
    />
  </form>

More details here - https://github.com/PacktPublishing/ASP.NET-Core-5-and-React-Second-Edition/issues/11

score:-1

Check that the package.json has:

"react-hook-form": "^6.12.2"

And when building:

npm install --legacy-peer-deps

Related Query

More Query from same tag