reactjs - 如何将 props 接管给其他组件?打字稿反应
问题描述
我的反应有问题。我应该如何在其他组件上使用道具?我想使用其他功能组件...
export const MainComponent = (props: ImportantProps): JSX.Element => {
return (
<OtherComponent {...this.props} />
);
export default function OtherComponent(props: ImportantProps) {
///
}
解决方案
推荐阅读
- java - 如何在 Hibernate 中为 CRUD 操作自定义通用持久性生命周期
- bash - 自动创建证书 OpenVPN
- javascript - Typescript 中的“HTMLElement”类型不存在属性“内容”
- quarkus - Quarkus 应用程序启动 bean 初始化两次
- github - 我是否拥有私有 Github 存储库中的代码?
- oracle - 如何在 oracle 查询中使用 into 子句为变量分配多个值?
- python - 用for循环python求解方程
- selenium - 如何通过 Selenium 使用 css-selector 查找元素
- php - VS Code PHP Intelephense 扩展是否有配置标志来关闭参数提示?
- python - 使用 Pyspark 从关系数据集构建层次结构