From 7de1527744a2e3a35cc4b8e7981611b3ec97fb26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E8=89=B3=E5=85=B5?= Date: Wed, 2 Sep 2026 14:01:38 +0800 Subject: [PATCH] refactor: use renderable guards --- package.json | 2 +- src/OptionList/Column.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 8bf2255e..c2b8babb 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "dependencies": { "@rc-component/select": "~1.11.0", "@rc-component/tree": "~1.5.0", - "@rc-component/util": "^1.11.1", + "@rc-component/util": "^1.13.0", "clsx": "^2.1.1" }, "devDependencies": { diff --git a/src/OptionList/Column.tsx b/src/OptionList/Column.tsx index 73afcc7c..fc80e4f4 100644 --- a/src/OptionList/Column.tsx +++ b/src/OptionList/Column.tsx @@ -1,6 +1,6 @@ import { clsx } from 'clsx'; import * as React from 'react'; -import { pickAttrs } from '@rc-component/util'; +import { isReactRenderable, pickAttrs } from '@rc-component/util'; import type { DefaultOptionType, SingleValueType } from '../Cascader'; import CascaderContext from '../context'; import { SEARCH_MARK } from '../hooks/useSearchOptions'; @@ -225,10 +225,10 @@ export default function Column {optionRender && value !== '__EMPTY__' ? optionRender(option) : label} - {!isLoading && expandIcon && !isMergedLeaf && ( + {!isLoading && isReactRenderable(expandIcon) && !isMergedLeaf && (
{expandIcon}
)} - {isLoading && loadingIcon && ( + {isLoading && isReactRenderable(loadingIcon) && (
{loadingIcon}
)}