support passing valid element

This commit is contained in:
SrGooglo 2023-06-30 17:12:05 +00:00
parent 03e0ef7f0c
commit b5303beab1

View File

@ -42,6 +42,10 @@ export const Icons = {
}
export function createIconRender(icon, props) {
if (React.isValidElement(icon)) {
return icon
}
if (typeof Icons[icon] !== "undefined") {
return React.createElement(Icons[icon], props)
}