将ReactJS拆分到多个程序集中

时间:2019-05-10 23:17:18

标签: javascript c# asp.net reactjs asp.net-core

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的组件分成多个程序集并在运行时加载它们吗?

1 个答案:

答案 0 :(得分:0)

是的。

我建议您阅读React official documentation

几乎每个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>
    }
}