mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 07:46:30 +01:00
fix(react): search crashing due to bad rendering mechanism
This commit is contained in:
@@ -21,7 +21,7 @@ export interface SearchOption {
|
||||
icon: string;
|
||||
label: string;
|
||||
tooltip?: string;
|
||||
component?: (props: SearchOptionProps) => VNode;
|
||||
component: (props: SearchOptionProps) => VNode;
|
||||
defaultValue?: string;
|
||||
additionalAttributesToDelete?: { type: "label" | "relation", name: string }[];
|
||||
}
|
||||
|
||||
@@ -95,15 +95,16 @@ export default function SearchDefinitionTab({ note, ntxId }: TabContext) {
|
||||
</tr>
|
||||
<tbody className="search-options">
|
||||
{searchOptions?.activeOptions.map(({ attributeType, attributeName, component, additionalAttributesToDelete, defaultValue }) => {
|
||||
return component?.({
|
||||
attributeName,
|
||||
attributeType,
|
||||
note,
|
||||
refreshResults,
|
||||
error,
|
||||
additionalAttributesToDelete,
|
||||
defaultValue
|
||||
});
|
||||
const Component = component;
|
||||
return <Component
|
||||
attributeName={attributeName}
|
||||
attributeType={attributeType}
|
||||
note={note}
|
||||
refreshResults={refreshResults}
|
||||
error={error}
|
||||
additionalAttributesToDelete={additionalAttributesToDelete}
|
||||
defaultValue={defaultValue}
|
||||
/>;
|
||||
})}
|
||||
</tbody>
|
||||
<BulkActionsList note={note} />
|
||||
|
||||
Reference in New Issue
Block a user