Reactjs 如何使React.Children.map与Typescript一起工作?
我有一个名为向导步骤的组件:Reactjs 如何使React.Children.map与Typescript一起工作?,reactjs,typescript,Reactjs,Typescript,我有一个名为向导步骤的组件: const WizardStep: React.FC<{ title: string }> = () => { /* */} 但是Typescript说,TS2339:props属性在类型“FC{title:string;}>”上不存在。 我该怎么做?你解决了这个问题吗?如果是,如何? Children.map( children, // a set of WizardStep ({ props: { title } }) =>
const WizardStep: React.FC<{ title: string }> = () => { /* */}
但是Typescript说,TS2339:props属性在类型“FC{title:string;}>”上不存在。
我该怎么做?你解决了这个问题吗?如果是,如何?
Children.map(
children, // a set of WizardStep
({ props: { title } }) => title
)