Skip to content

Commit a394458

Browse files
committed
Fix Button hydration bug
1 parent 4e9f374 commit a394458

File tree

1 file changed

+4
-7
lines changed
  • frontend/src/app/(auth)/leetcode-dashboard

1 file changed

+4
-7
lines changed

frontend/src/app/(auth)/leetcode-dashboard/page.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import Container from "@/components/ui/Container";
55
import { PlusIcon } from "lucide-react";
66
import { Dialog, DialogTrigger } from "@/components/ui/dialog";
77
import AddQuestionDialog from "@/app/(auth)/leetcode-dashboard/AddQuestionDialog";
8-
import { Button } from "@/components/ui/button";
9-
import { useState } from "react";
108

119
const LeetcodeDashboardHeader = () => {
1210
return (
@@ -29,15 +27,14 @@ const LeetcodeDashboard = () => {
2927
<LeetcodeDashboardHeader />
3028
<div className="flex justify-end mb-4">
3129
<Dialog>
32-
<DialogTrigger>
33-
<Button>
34-
<PlusIcon /> Add A Question
35-
</Button>
30+
{/* Unable to reuse Button as cannot render Button inside DialogTrigger (causes hydration error) */}
31+
<DialogTrigger className="bg-yellow-500 text-primary-foreground hover:bg-yellow-300 rounded flex text-primary-900 p-3">
32+
<PlusIcon /> Add A Question
3633
</DialogTrigger>
3734
<AddQuestionDialog />
3835
</Dialog>
3936
</div>
40-
<LeetcodeDashboardTable />
37+
{/* <LeetcodeDashboardTable /> */}
4138
</Container>
4239
);
4340
};

0 commit comments

Comments
 (0)