From a430284aa21e3ae1f0d5654e55b2ad2852519cc2 Mon Sep 17 00:00:00 2001
From: wwf <yearningwang@iqtogether.com>
Date: 星期三, 04 六月 2025 15:17:49 +0800
Subject: [PATCH] 初始化

---
 app/components/base/icons/IconBase.tsx |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/app/components/base/icons/IconBase.tsx b/app/components/base/icons/IconBase.tsx
index 134c948..994cd98 100644
--- a/app/components/base/icons/IconBase.tsx
+++ b/app/components/base/icons/IconBase.tsx
@@ -1,3 +1,4 @@
+import { forwardRef } from 'react'
 import { generate } from './utils'
 import type { AbstractNode } from './utils'
 
@@ -13,14 +14,7 @@
   style?: React.CSSProperties
 }
 
-const IconBase = (
-  {
-    ref,
-    ...props
-  }: IconBaseProps & {
-    ref?: React.RefObject<React.MutableRefObject<HTMLOrSVGElement>>;
-  },
-) => {
+const IconBase = forwardRef<React.MutableRefObject<HTMLOrSVGElement>, IconBaseProps>((props, ref) => {
   const { data, className, onClick, style, ...restProps } = props
 
   return generate(data.icon, `svg-${data.name}`, {
@@ -32,8 +26,6 @@
     ...restProps,
     'ref': ref,
   })
-}
-
-IconBase.displayName = 'IconBase'
+})
 
 export default IconBase

--
Gitblit v1.8.0