Skip to content

Commit 7f8a138

Browse files
committed
Fix plan page hydration error
1 parent 94aa306 commit 7f8a138

File tree

6 files changed

+59
-6
lines changed

6 files changed

+59
-6
lines changed

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
}

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default defineConfig({
2222
/* Retry on CI only */
2323
retries: process.env.CI ? 2 : 0,
2424
/* Opt out of parallel tests on CI. */
25-
workers: process.env.CI ? 1 : undefined,
25+
workers: "50%",
2626
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
2727
reporter: [["html", { open: "never" }]],
2828
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */

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)