MCPcopy Create free account
hub / github.com/churichard/notabase / ProvideCurrentNote

Function ProvideCurrentNote

utils/useCurrentNote.tsx:10–18  ·  view source on GitHub ↗
({
  children,
  value,
}: {
  children: ReactNode;
  value: CurrentNote;
})

Source from the content-addressed store, hash-verified

8const NoteContext = createContext<CurrentNote | undefined>(undefined);
9
10export function ProvideCurrentNote({
11 children,
12 value,
13}: {
14 children: ReactNode;
15 value: CurrentNote;
16}) {
17 return <NoteContext.Provider value={value}>{children}</NoteContext.Provider>;
18}
19
20export const useCurrentNote = () => {
21 const context = useContext(NoteContext);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected