MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / PageDataProvider

Function PageDataProvider

packages/ui-next/src/context/page-data.tsx:28–33  ·  view source on GitHub ↗
({ initial, children }: PageDataProviderProps)

Source from the content-addressed store, hash-verified

26}
27
28export function PageDataProvider({ initial, children }: PageDataProviderProps) {
29 const [data, setData] = useState<PageData>(initial);
30 const value = useMemo(() => ({ data, setData }), [data]);
31
32 return <PageDataContext.Provider value={value}>{children}</PageDataContext.Provider>;
33}
34
35function usePageDataContext(): PageDataContextValue {
36 const ctx = useContext(PageDataContext);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected