如何动态获取某个组件的 props
类型?
#11634
Replies: 1 comment
-
其实是可用的,是因为定义类型时没有写泛型 // 开始节点
const startNode: PatternItem<typeof StartNodeView> = {
type: AiNodeType.START_NODE,
label: '开始节点',
icon: StartNodeView,
iconProps: {
text: '开始',
},
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
我有这么一个需求
iconProps
的类型其实是icon
的 props 类型,使用ComponentProps
发现获取到的是 any。有什么其他的方式可以获取吗?Beta Was this translation helpful? Give feedback.
All reactions