MCPcopy
hub / github.com/michaelshimeles/nextjs-starter-kit / useChart

Function useChart

components/ui/chart.tsx:27–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25const ChartContext = React.createContext<ChartContextProps | null>(null)
26
27function useChart() {
28 const context = React.useContext(ChartContext)
29
30 if (!context) {
31 throw new Error("useChart must be used within a <ChartContainer />")
32 }
33
34 return context
35}
36
37function ChartContainer({
38 id,

Callers 2

ChartTooltipContentFunction · 0.85
ChartLegendContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected