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
Refactor: enhance useScrollToErrorOnSubmit hook with TypeScript types and memoization
- Updated methods parameter in UseScrollToErrorOnSubmitOptions to use FieldValues for better type safety.
- Improved memoization of scroll options to prevent unnecessary re-renders.
- Adjusted condition for handling server-side validation errors on mount to ensure proper functionality.
console.warn('useScrollToErrorOnSubmit: No form methods available. Make sure you are either inside a RemixFormProvider or passing methods explicitly.');
23
-
return;
24
-
}
25
-
27
+
26
28
const{ formState }=formMethods;
27
29
28
30
// Memoize scroll options to prevent unnecessary re-renders
0 commit comments