Skip to content

Commit 1819f56

Browse files
committed
Fix plan page hydration error
1 parent f967114 commit 1819f56

5 files changed

Lines changed: 58 additions & 5 deletions

File tree

‎app/(dashboard)/pricing/submit-button.tsx‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
"use client";
22

33
import { ArrowRight, Loader2 } from "lucide-react";
4+
import { useEffect, useState } from "react";
45
import { useFormStatus } from "react-dom";
56
import { Button } from "@/components/ui/button";
67

78
export function SubmitButton() {
89
const { pending } = useFormStatus();
10+
const [isHydrated, setIsHydrated] = useState(false);
11+
12+
useEffect(() => {
13+
setIsHydrated(true);
14+
}, []);
915

1016
return (
1117
<Button
1218
type="submit"
13-
disabled={pending}
19+
disabled={pending || !isHydrated}
1420
variant="outline"
1521
className="w-full rounded-full"
1622
>

‎package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"devDependencies": {
4444
"@biomejs/biome": "^2.2.2",
4545
"@playwright/test": "^1.55.0",
46-
"@types/bun": "^1.2.21"
46+
"@types/bun": "^1.2.21",
47+
"endform": "^0.35.0"
4748
}
4849
}

‎pnpm-lock.yaml‎

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tutorial/stage-0-baseline/from-cowboy-to-confidence.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ Here's what we'll cover in each step:
6767
/>
6868

6969
<LinkCard
70-
title="Speeding up with endform"
71-
description="Use endform to speed up your test suite."
70+
title="Speeding up with Endform"
71+
description="Use Endform to speed up your test suite."
7272
href="/docs/tutorial/speeding-up-with-endform"
7373
/>
7474

‎tutorial/stage-3-endform-integration/speeding-up-with-endform.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Speeding up with endform
2+
title: Speeding up with Endform
33
description: Use endform to speed up your test suite.
44
sidebar:
55
order: 4

0 commit comments

Comments
 (0)