We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 358b873 commit 02dab51Copy full SHA for 02dab51
1 file changed
apps/web/components/apps/routing-forms/Header.tsx
@@ -23,7 +23,7 @@ const useRoutingFormNavigation = (
23
) => {
24
const pathname = usePathname();
25
const router = useRouter();
26
- const formContext = useFormContext<RoutingFormWithResponseCount>();
+ const { isDirty } = useFormContext<RoutingFormWithResponseCount>().formState;
27
28
// Get the current page based on the pathname since we use a custom routing system
29
const getCurrentPage = () => {
@@ -39,7 +39,7 @@ const useRoutingFormNavigation = (
39
40
const baseUrl = `${appUrl}/${value}/${form.id}`;
41
42
- if (value === "route-builder" && formContext.formState.isDirty) {
+ if (value === "route-builder" && isDirty) {
43
setShowInfoLostDialog(true);
44
} else {
45
router.push(baseUrl);
0 commit comments