Forms - Equivalent to useFormContext() from React but in Blazor 8

28 views Asked by At

I was working with React for at least 2 years in my past job and recently i changed to a position where the frontend is being created with Blazor 8.

I was wondering if exist any equivalent to the method useFormContext from the library react-hook-form but in Blazor.

With that hook i was able to access to values, errors and other stuff from all the inputs that were wrapped by a form tag.

I did a little research about this feature on Blazor and i found out that i can do a @bind-Form but is not able to passing it as a cascading parameter and i need to referer that @bind to all my child components wrapped with the EditForm tag.

I will be so grateful if someone shares any repo where I can find something similar to this functionality.

I research in microsoft documentation, reddit and stackoverflow and i just want to find out someone that had the same problem and try to figure out a way to avoid to pass the Form parameter component-by-component by hand.

Why i want do that?

I just want to avoid enormous form components and trying to do atomic ones.

0

There are 0 answers