Chuyển đến nội dung
Yuva roadmap hooksMenu

Yuva roadmap hooks

React hooks over the useyuva headless client for a public roadmap board: the board and its stage counts, the ideas of a stage by top votes or newest with a title search, voting and suggesting an idea. Built on the discussion hooks. Labels with English defaults.

Loading

  • Loading

Bản xem trước chạy trên dữ liệu mẫu. Không cần mạng hay kênh.

Cài đặt

Chạy lệnh này trong một dự án shadcn. Các tệp được sao chép vào mã của bạn.

Shell
npx shadcn@latest add https://useyuva.com/r/use-yuva-roadmap.json

Cách dùng

tsx
import { useIdeas, useRoadmap } from "@/hooks/use-yuva-roadmap"

const { board } = useRoadmap()
const { ideas, vote } = useIdeas("planned", "top")

Props

RoadmapResult

PropKiểu
boardClientRoadmap | null
loadingboolean
errorunknown
reload() => Promise<void>

IdeasResult

PropKiểu
ideasDiscussion[]
loadingboolean
errorunknown
hasMoreboolean
loadMore() => Promise<void>
reload() => Promise<void>
suggest(input: IdeaInput) => Promise<Discussion>
vote(idea: Discussion) => Promise<void>

Nhãn

Các nhãn được liệt kê ở Yuva roadmap.

Phụ thuộc

Cài mục này cũng sẽ thêm các mục sau.

Các mục Yuva khác

Gói npm