fix(Watch): correct render function parameter typing#13108
fix(Watch): correct render function parameter typing#13108bluebill1049 merged 3 commits intoreact-hook-form:masterfrom
Conversation
|
could you include some tests? |
I moved the type assertions into a |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a TypeScript typing issue in the Watch component by adding the const modifier to the TFieldNames generic parameter. This change enables TypeScript to infer the exact tuple type of field names rather than widening them to a general array type, which improves type safety for the render function parameters.
- Added
consttype parameter modifier toTFieldNamesgeneric in theWatchcomponent - Moved type tests from runtime test file to a dedicated TypeScript test file
- Updated API documentation to reflect the signature change
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/watch.tsx | Added const modifier to TFieldNames generic parameter to preserve literal tuple types |
| src/typetest/watch.test-d.ts | Added new TypeScript-specific type test for verifying render function parameter types |
| src/tests/watch.test.tsx | Removed runtime type test that was moved to dedicated type test file |
| reports/api-extractor.md.api.md | Updated API signature documentation to reflect the const modifier addition |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@bluebill1049 Could you publish this pr? this issue is a blocker for me to use |
fixes #13105