MCPcopy Create free account
hub / github.com/AmazingAng/PolyWorld / assignRef

Function assignRef

src/components/MarketsPanel.tsx:42–49  ·  view source on GitHub ↗
(ref: React.Ref<T> | undefined, value: T | null)

Source from the content-addressed store, hash-verified

40}
41
42function assignRef<T>(ref: React.Ref<T> | undefined, value: T | null) {
43 if (!ref) return;
44 if (typeof ref === "function") {
45 ref(value);
46 return;
47 }
48 (ref as React.MutableRefObject<T | null>).current = value;
49}
50
51type SortOrder = "sections" | "volume" | "impact" | "change" | "new";
52const CATEGORIES: Category[] = ["Politics", "Crypto", "Sports", "Finance", "Tech", "Culture", "Other"];

Callers 1

MarketsPanelInnerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected