Reactjs 如何将道具转移到其他组件?打字稿反应
我的反应有问题。 我应该如何将道具置于其他组件之上? 我想使用其他功能组件Reactjs 如何将道具转移到其他组件?打字稿反应,reactjs,Reactjs,我的反应有问题。 我应该如何将道具置于其他组件之上? 我想使用其他功能组件 export const MainComponent = (props: ImportantProps): JSX.Element => { return ( <OtherComponent {...this.props} /> ); export default function OtherComp
export const MainComponent = (props: ImportantProps): JSX.Element => {
return (
<OtherComponent {...this.props} />
);
export default function OtherComponent(props: ImportantProps) {
///
}
export const MainComponent=(props:ImportantProps):JSX.Element=>{
返回(
);
导出默认函数OtherComponent(道具:ImportantProps){
///
}
这是一个功能组件,请移除此应使其工作。这是一个功能组件,请移除此应使其工作