KanBan/src/BoardPage.tsx

21 lines
559 B
TypeScript
Raw Normal View History

2024-03-28 02:35:53 +00:00
import { useRef, useEffect } from "kaioken"
import { Board } from "./components/Board"
import { useGlobal } from "./state/global"
export function BoardPage({ params }: { params: Record<string, any> }) {
const rootElementRef = useRef<HTMLDivElement>(null)
const { setRootElement } = useGlobal()
useEffect(() => {
if (!rootElementRef.current) return
setRootElement(rootElementRef.current)
}, [rootElementRef.current])
const { boardId } = params
return (
<main ref={rootElementRef}>
<Board boardId={boardId} />
</main>
)
}