We have many complex "form controls" in the app. Most of them are based on others. As we reuse them inside each other we get a large and deep DOM tree. Is there a better way to approach this?
For example:
- Auto complete
- Auto complete with drop down
- Auto complete with drop down with checkbox
- A switch form with drop down controlling what to show - 1 or 2 or 3
Just to make clear by saying drop down I mean logically too (specific items with specific template and interactions). Each of those components are used multiple times in the app (4 times and more).
For reusability we use 1 in 2 and 2 in 3 and 1,2,3 in 4. That means that 4 already has 3 nested components inside. The real case is deeper unfortunately. How should one tackle such case? We do see a performance impact from those components - especially when a page render a few of them (say 6 times).
We are using onPush on everything and using reactive forms. The main performance impact is the components creation.