Replies: 3 comments 24 replies
-
provide a simple codesandbox please. |
Beta Was this translation helpful? Give feedback.
-
Is there some official solution or progress about this issue? we also met this problem. |
Beta Was this translation helpful? Give feedback.
-
Here's my proposal to solve the issue. @bluebill1049 could you tell me what you think? If you see no red flag, I can attempt a PR. Main ideaThis proposal aims at giving developers more flexibility when defining errors objects in react-hook-form. The main idea is to add a export type FieldError = {
// ... existing properties
message?: Message;
// -- new property --
data?: unknown;
}; RHF will treat the new property as opaque and just forward it along. In application space, developers can pick whichever information they need from Producing
|
Beta Was this translation helpful? Give feedback.
-
I'm using i18next to translate our site and the user can switch between languages. However, RHF's error messages don't translate when toggling between languages.
I have tried calling
trigger()
andcontrol.reRender()
on language change but nothing helps, bar reloading the page. If you have any advice on how to force reload the validation schema, it would be greatly appreciated.Beta Was this translation helpful? Give feedback.
All reactions