export type IconComponent = typeof QuestionCircleOutlined 如何理解这句代码呢? #388
Unanswered
liaodalin19903
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
在读源码的时候:
https://github.com/antvis/XFlow/blob/b7cdb995f0404b549c7a40832ba6bb7f9a382976/packages/xflow-core/src/antd-icons/index.tsx#LL3C1-L3C1
这里:
这里有疑问:
1、为何是 typeof QuestionCircleOutlined 呢?
是否typeof任何一个@ant-design/icons' 的都可以?比如:QuestionOutlined

2、我查看了ant-design-icons的源码:
https://github.com/ant-design/ant-design-icons/blob/5be2afd296636ab4cfec5d3a2793d6cd41b1789b/packages/icons-react/src/icons/QuestionCircleOutlined.tsx
QuestionCircleOutlined 本质是一个function,
但是我在XFlow中测试打印( typeof QuestionCircleOutlined )却是一个对象:
打印(QuestionCircleOutlined)的结果为:
Beta Was this translation helpful? Give feedback.
All reactions