mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
fix: 修复 generateIcon 可能传入 jsx.element 对象时的报错 (#2890)
This commit is contained in:
parent
9cd89bd2ee
commit
4821cfcb48
@ -17,6 +17,10 @@ export const generateIcon = (
|
|||||||
className?: string,
|
className?: string,
|
||||||
classNameProp?: string
|
classNameProp?: string
|
||||||
) => {
|
) => {
|
||||||
|
if (React.isValidElement(icon)) {
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
const isURLIcon = icon?.indexOf('.') !== -1;
|
const isURLIcon = icon?.indexOf('.') !== -1;
|
||||||
|
|
||||||
return icon ? (
|
return icon ? (
|
||||||
|
Loading…
Reference in New Issue
Block a user