Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 封装了 Icon 组件后,无法检测到本地图标 #12648

Closed
haohaio opened this issue Aug 17, 2024 · 1 comment
Closed

[Bug] 封装了 Icon 组件后,无法检测到本地图标 #12648

haohaio opened this issue Aug 17, 2024 · 1 comment

Comments

@haohaio
Copy link

haohaio commented Aug 17, 2024

What happens?

想要像字体图标一样使用 Icon, 故对 Icon 组件进行了封装,但会导致无法检测到本地图标

Mini Showcase Repository(REQUIRED)

组件实现

import type { ComponentProps } from 'react';
import { Icon } from 'umi';

const MyIcon: React.FC<ComponentProps<typeof Icon>> = (props) => {
  return <Icon width="1em" height="1em" fill="currentColor" {...props} />;
};

export default MyIcon;

How To Reproduce

跟使用 Icon 组件一样,但是由于检测不到本地图标,什么也不会渲染。

<MyIcon icon="local:home" className="text-[12px] text-[red]" />

Context

  • Umi Version: 4.3.12
  • Node Version: v18.16.1
  • Platform: MacOS
Copy link

由于缺乏足够的信息,我们暂时关闭了该 Issue。请修改(不要回复) Issue 提供最小重现以重新开启。谢谢。

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant