fix(react): search crashing due to bad rendering mechanism

This commit is contained in:
Elian Doran
2025-08-27 17:46:20 +03:00
parent 40e4d236f4
commit 2152ca7ba6
2 changed files with 11 additions and 10 deletions

View File

@@ -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 }[];
}

View File

@@ -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} />