diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx index 13eff8c46..48a9590e5 100644 --- a/apps/client/src/widgets/react/hooks.tsx +++ b/apps/client/src/widgets/react/hooks.tsx @@ -291,7 +291,7 @@ export function useNoteRelation(note: FNote | undefined | null, relationName: st * @returns an array where the first element is the getter and the second element is the setter. The setter has a special behaviour for convenience: if the value is undefined, the label is created without a value (e.g. a tag), if the value is null then the label is removed. */ export function useNoteLabel(note: FNote | undefined | null, labelName: string): [string | null | undefined, (newValue: string | null | undefined) => void] { - const [ labelValue, setLabelValue ] = useState(note?.getLabelValue(labelName)); + const [ , setLabelValue ] = useState(); useEffect(() => setLabelValue(note?.getLabelValue(labelName) ?? null), [ note ]); useTriliumEvent("entitiesReloaded", ({ loadResults }) => { @@ -319,7 +319,7 @@ export function useNoteLabel(note: FNote | undefined | null, labelName: string): useDebugValue(labelName); return [ - labelValue, + note?.getLabelValue(labelName), setter ] as const; }