04. Accessing Component Properties

The Problem

A parent may need to read a value exposed by a business component, such as a selected customer or entered age.

The React Difficulty

React's normal data flow is declarative. Reading a child value imperatively usually requires a ref or lifting the state to a common owner.

React Approach

const ageRef = useRef(null);

function Customer() {
    return <input ref={ageRef} />;
}

const value = ageRef.current?.value;

MS Approach

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

const person = await ms.inject("./Person", "content");
const age = person.txtAge;

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.