07. Deep Component Injection

The Problem

A wizard or tab can contain another screen, which can itself contain another screen. The parent should not need to know every DOM detail of every descendant.

The React Difficulty

React can compose nested components naturally, but dynamically targeting an already-created descendant requires passing references, state, render props, portals, or another explicit composition mechanism.

React Approach

function Wizard() {
    return (
        <div>
            <WizardStep />
        </div>
    );
}

function WizardStep() {
    return <CustomerStep />;
}

MS Approach

ManySet provides a direct runtime-oriented approach for this recurring business-application task.

const a = await ms.inject('A', ms.id('DivA'));
const b = await ms.inject('B', a.divB);
const c = await ms.inject("C", b.divC);

Why this way is useful in business applications :

The comparison is intended to show where ManySet supplies a business-application abstraction around a recurring task, while keeping HTML and JavaScript visible and directly usable.

Key Point :

ManySet reduces the amount of framework-specific composition required for this particular task, without requiring the React/Angular mechanism to be represented as inherently wrong or incapable.