-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "✨ Add support for generic components using `FieldPat… (…
…#6753) * Revert "Revert "✨ Add support for generic components using `FieldPathWithValue` (#6562)" (#6717)" This reverts commit 08883bb. * keep FieldError simple * fix with error object with only FieldError type * 7.18.0-next.0 * include test case for controller with type check
- Loading branch information
1 parent
e373b4b
commit f42add5
Showing
5 changed files
with
187 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import { ControllerProps, FieldPath, FieldValues } from './types'; | ||
import { ControllerProps, FieldPathWithValue, FieldValues } from './types'; | ||
import { useController } from './useController'; | ||
|
||
const Controller = < | ||
TFieldValues extends FieldValues = FieldValues, | ||
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, | ||
TResult = any, | ||
TName extends FieldPathWithValue<TFieldValues, TResult> = FieldPathWithValue< | ||
TFieldValues, | ||
TResult | ||
>, | ||
>( | ||
props: ControllerProps<TFieldValues, TName>, | ||
) => props.render(useController<TFieldValues, TName>(props)); | ||
props: ControllerProps<TFieldValues, TResult, TName>, | ||
) => props.render(useController<TFieldValues, TResult, TName>(props)); | ||
|
||
export { Controller }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters