dohomi/react-hook-form-mui

Feature Request: Add support for isLoading on FormState

Closed this issue ยท 1 comments

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary ๐Ÿ’ก

The following is a proposal to add support for isLoading property on FormState.

isLoading is used to track the loading of defaultValues when it is an asynchronous function.

I would like to propose adding custom skeletons for all the components this library provides. Which will appear when isLoading is true on FormState.

NOTE:
I am willing to take on the work, if you are open to the proposal.

Examples ๐ŸŒˆ

Current Behavior:
When an asynchronous defaultValues is provided the fields remain empty/blank but still allow for user interaction. Then once defaultValues completes all fields get set.

Expected Behavior:
When an asynchronous defaultValues is provided the fields will display a skeleton based on the component which will not allow for user interactions. Then once defaultValues completes all fields get set.

@NicholasMata, you can create a wrapper component to achieve the behavior of displaying a skeleton when formState.isLoading is true.

Including a skeleton or loader for components like TextField, Radio, etc., would introduce unnecessary overhead to the library. This is something that I believe should be handled by the developer on their own.