Comments (3)
This evening, I was stumped by this for a while. putting the full code if it helps somebody.
<form onSubmit={handleSubmit}>
<input
{...register("search")} defaultValue={criteria}
placeholder="type here"
type="text"
/>
</form>
from asp.net-core-5-and-react-second-edition.
The API in React Hook Form has changed a little since the book was published. You can install v6 as follows if you want to use the code from the book:
npm i [email protected]
If you want to use v7 of React Hook Form, see the following link for the differences:
https://react-hook-form.com/migrate-v6-to-v7/
For the code in the book, you’ll need to change how the register
function is called on the JSX elements and how the errors
state variable is destructured from useForm
.
Hope this helps.
from asp.net-core-5-and-react-second-edition.
I met the same error. If you installed react-hook-form v7.1.1, you can refer to the author's example.
https://codesandbox.io/s/react-hook-form-get-started-ts-5ksmm?file=/src/index.tsx
from asp.net-core-5-and-react-second-edition.
Related Issues (11)
- From your code while trying to ask a question this error occurs HOT 2
- Compiling error with "ref" attribute - Chapter 6 - Header.tsx HOT 2
- In chapter 12, why do we no longer have Store.ts file in frontend part? HOT 2
- In chapter 7 Creating the store HOT 1
- I have problem when authorized users post questions and press ask question button i get error
- No user.svg for chapter 3 start
- Chapter-03 finish react-scripts start issue HOT 2
- Chapter 6 Page 193 code issue HOT 2
- Chapter 12 don't use Redux anymore, help!
- '"react-router-dom"' has no exported member named 'Routes'. (in chapter 5) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asp.net-core-5-and-react-second-edition.