Skip to content

Build your personal knowledge base with Trilium Notes

chore(client): fix typecheck

Elian Doran26f7264f3cb9
diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx
index f30957befd..34a7c9ed8a 100644
--- a/apps/client/src/widgets/react/hooks.tsx
+++ b/apps/client/src/widgets/react/hooks.tsx
@@ -258,7 +258,7 @@ export function useUniqueName(prefix?: string) {
export function useNoteContext() {
const noteContextContext = useContext(NoteContextContext);
- const [ noteContext, setNoteContext ] = useState<NoteContext | null>(noteContextContext);
+ const [ noteContext, setNoteContext ] = useState<NoteContext | undefined>(noteContextContext ?? undefined);
const [ notePath, setNotePath ] = useState<string | null | undefined>();
const [ note, setNote ] = useState<FNote | null | undefined>();
const [ , setViewScope ] = useState<ViewScope>();