Fixed hydration errors
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
CardHeader,
|
CardHeader,
|
||||||
@@ -31,6 +31,13 @@ const id = (prefix = "t") =>
|
|||||||
|
|
||||||
export default function BoardView() {
|
export default function BoardView() {
|
||||||
const [columns, setColumns] = useState<Record<string, Task[]>>({
|
const [columns, setColumns] = useState<Record<string, Task[]>>({
|
||||||
|
todo: [],
|
||||||
|
inprogress: [],
|
||||||
|
done: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setColumns({
|
||||||
todo: [
|
todo: [
|
||||||
{ id: id(), title: "Buy groceries" },
|
{ id: id(), title: "Buy groceries" },
|
||||||
{ id: id(), title: "Plan sprint" },
|
{ id: id(), title: "Plan sprint" },
|
||||||
@@ -51,6 +58,7 @@ export default function BoardView() {
|
|||||||
],
|
],
|
||||||
done: [],
|
done: [],
|
||||||
});
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
function onDragEnd(result: any) {
|
function onDragEnd(result: any) {
|
||||||
const { source, destination } = result;
|
const { source, destination } = result;
|
||||||
@@ -87,7 +95,7 @@ export default function BoardView() {
|
|||||||
<Card
|
<Card
|
||||||
ref={provided.innerRef}
|
ref={provided.innerRef}
|
||||||
{...provided.droppableProps}
|
{...provided.droppableProps}
|
||||||
className="min-h-[170px] bg-background"
|
className="bg-background"
|
||||||
>
|
>
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle className="flex items-center justify-between">
|
<CardTitle className="flex items-center justify-between">
|
||||||
|
|||||||
Reference in New Issue
Block a user