fix: 修复 generateIcon 可能传入 jsx.element 对象时的报错 (#2890)

This commit is contained in:
liaoxuezhi 2021-11-09 15:07:09 +08:00 committed by GitHub
parent 9cd89bd2ee
commit 4821cfcb48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,10 @@ export const generateIcon = (
className?: string,
classNameProp?: string
) => {
if (React.isValidElement(icon)) {
return icon;
}
const isURLIcon = icon?.indexOf('.') !== -1;
return icon ? (