You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I recently integrated this library into my stack and I stumbled upon a wierd issue. I attempted to clean up my code by decomposing certain complex fields into their own functions to keep the code readable, but due to this, schema errors are not shown anymore.
I did some investigation and it seems that the react-hook-form library is aware of the error, but for some reason, the message is not displayed. The (I believe) exact same code works if the definition is in-line.
The decomposition I went with is very simple, but feels "hacky" in the context of this library as I needed to extract the correct typing as follows:
type FormRenderProperties<Schema extends FormSchema> = Parameters<NonNullable<FormProps<Schema>["children"]>>[0];,
Bug description
Hi, I recently integrated this library into my stack and I stumbled upon a wierd issue. I attempted to clean up my code by decomposing certain complex fields into their own functions to keep the code readable, but due to this, schema errors are not shown anymore.
I did some investigation and it seems that the
react-hook-form
library is aware of the error, but for some reason, the message is not displayed. The (I believe) exact same code works if the definition is in-line.The decomposition I went with is very simple, but feels "hacky" in the context of this library as I needed to extract the correct typing as follows:
type FormRenderProperties<Schema extends FormSchema> = Parameters<NonNullable<FormProps<Schema>["children"]>>[0];
,as the Children type is not exported.
Reproduction
Minimal issue reproduction repo (using Vite): repr, relevant file
Final notes
I may have chosen inappropriate means for cleanup, but I did not manage to find an example that showcases any decomposition, or field re-usability.
Despite some quirks, this is a great library and I would like to thank the authors for sharing it.
The text was updated successfully, but these errors were encountered: