[Bug]: Document issue
See original GitHub issueVersion Number
7.15.4
Codesandbox/Expo snack
https://codesandbox.io/s/sweet-dream-58m9v
Steps to reproduce
- Code was copied from the documentation.
- Run
tsc
- Or in VSCode in the line it shows the error.
Expected behaviour
Without any issue.
What browsers are you seeing the problem on?
No response
Relevant log output
Type error: Type '(values: unknown, context: object, options: ResolverOptions<AssertsShape<Assign<ObjectShape, { firstName: RequiredStringSchema<string, Record<string, any>>; age: RequiredNumberSchema<number, Record<...>>; }>>>) => Promise<...>' is not assignable to type 'Resolver<IFormInputs, object>'.
Types of parameters 'options' and 'options' are incompatible.
Type 'ResolverOptions<IFormInputs>' is not assignable to type 'ResolverOptions<AssertsShape<Assign<ObjectShape, { firstName: RequiredStringSchema<string, Record<string, any>>; age: RequiredNumberSchema<number, Record<string, any>>; }>>>'.
Type 'IFormInputs' is not assignable to type 'AssertsShape<Assign<ObjectShape, { firstName: RequiredStringSchema<string, Record<string, any>>; age: RequiredNumberSchema<number, Record<string, any>>; }>>'.
Index signature for type 'string' is missing in type 'IFormInputs'.
53 | formState: { errors },
54 | } = useForm<IFormInputs>({
> 55 | resolver: yupResolver(schema),
| ^
56 | });
57 | const onSubmit = (data: IFormInputs) => console.log(data);
58 |
error Command failed with exit code 1.
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:34 (22 by maintainers)
Top Results From Across the Web
How to Write A Good Bug Report? Tips and Tricks
Summary: A brief summary of the bug, mostly within 60 words or below. Make sure your summary is reflecting on what the problem...
Read more >What Is A Bug Report? The Essential Guide + Examples Of ...
So here's the core question: What is a bug report? If bugs occur (which they certainly do), the person finding the bug should...
Read more >14 Bug Reporting Templates You Can Copy for Your QA ...
Check out these 14 super actionable bug report templates, tailored for your issue tracker like Jira, GitHub, Trello, Asana, Excel and more.
Read more >How to write a bug report effectively: examples and templates
Briefly describe the bug, i.e. "Calculator: incorrect result of multiplication". Try to be concise, but specific here. For example, "Broken ...
Read more >How to write an actionable bug report (free template to get ...
Bug reports allow testers to document issues, bring them to the attention of the developers, and set in motion the process that will ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@wroughtec adding the
.required()
fix the issue as well.follow the updated doc for now: https://react-hook-form.com/get-started#SchemaValidation @vtrphan