[TOC]
在 React 中,可以根据 props 和 state 的不同,返回不同的 UI 元素。
考虑两个组件:
有很多应用场景,我们需要动态生成组件,动态组件一般借助 ComponentFactoryResolver
服务来实现,之前需要了解一些先验知识。
Angular 有一个概念叫做视图(View),视图由其引用对象(ViewRef)表示,其源码说明如下:
A View is a fundamental building block of the application UI. It is the smallest grouping of Elements which are created and destroyed together. >