javascript - 将 ReactJS 拆分为多个程序集
问题描述
我ve got a modular .NET application, which loads controllers, views and components from assemblies as plugins.
Going to learn React (totally new to it) - and got a question. Does React support splitting it
将组件放入多个程序集中并在运行时加载它们?
解决方案
是的,它确实。
我建议你阅读 React官方文档。
几乎每个 React 组件都会生成一些 HTML 标记供浏览器显示。组件拆分的一般思想是像这样在几个组件之间拆分 HTML 标记
// App.js
class App extends React.Component {
render () {
return <div>
My first component
<Component1/>
</div>
}
}
// Component1.js
export default class Component1 extends React.Component {
render () {
return <div>
This is internals of component
</div>
}
}
推荐阅读
- visual-studio-code - 在 Visual Studio Code 中设置企业网络代理?
- python - 有没有办法解决 yB = c 而不计算正确的逆?
- angular - RxJS:如何为(可选)请求定义(最大)持续时间?
- aws-lambda - AWS Lambda 使用来自不同区域的 SQS 的消息
- pandas - 绘制具有不同数据点数量的两列数据
- firebase - 如何处理 Flutter 上的 Firebase 身份验证异常
- join - 将字符加入列数组
- r - 是否有用于使用 gramian-angular-fields-method (gaf/gasf) 将时间序列编码为图像的 R 函数?
- sql-server - 更改跟踪:TRACK_COLUMNS_UPDATED 不起作用?
- java - 像 Whatsapp 一样的自定义 ImageView 裁剪