
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@mvc-react/components
Advanced tools
Framework for developing MVC-based React components. It is based on @mvc-react/mvc (see more here).
npm install --save @mvc-react/components
This package allows you to utilize MVC-patterned components (ModeledComponents). The components
take in a single prop model which models what the UI displays and how the user interacts with it. An additional children prop is available for container components (ModeledContainerComponent).
When properly implemented, this framework:
ModeledVoidComponentEncapsulates a functional react component which is patterned after a Model, and has no children.
const Book: ModeledVoidComponent<BookModel> = function ({ model }) {
const { title, author, cover } = model.modelView;
return (
<div className="book">
<img className="book-cover" src={cover.src} alt={cover.alt} />
<span className="book-title">{title}</span>
<span className="author">{author}</span>
</div>
);
};
const BookRepository = function({ model }) {
const { bookModels } = model.modelView;
const { interact } = model.interact;
return (
<>
<div className='books-container'>
<ComponentList // This component is available out-of-the-box
model={newReadonlyModel({
Component: Book,
componentModels: bookModels,
})}
/>
</div>
<button onClick={interact({"Refresh Models"})}>Refresh</button>
</>
);
} as ModeledVoidComponent<BookRepositoryModel>
ModeledContainerComponentEncapsulates a functional react component which is patterned after a Model, and has children.
const SiteSection = function ({ model, children }) {
const { sectionTitle } = model.modelView;
return (
<section className="site-section">
<h2 className="section-title">{sectionTitle}</h2>
{children}
</section>
);
} as ModeledContainerComponent<SiteSectionModel>;
The package also comes with a couple of general purpose ModeledComponents which fulfil common
tasks like listing and placeholdering.
ComponentListComponent that maps a list of models to their respective components. (see Example 2).
ModelView propertiescomponentModels - List of models, each to be mapped to a Component.Component - The ModeledComponent each component model will be mapped to.ComponentPlaceholderComponent that renders an alternative component in place of a ModeledComponent whose model
is not yet defined.
ModelView propertiesplaceholderedComponentModel - Model of placeholdered component.PlaceholderedComponent - Component the placeholdered model will be mapped to when defined.PlaceholderComponent - Placeholder componentconst BookPlaceholder = function ({ model }) {
const { bookModel } = model.modelView;
return (
<ComponentPlaceholder
model={newReadonlyModel({
placeholderedComponentModel: bookModel,
PlaceholderedComponent: Book,
PlaceholderComponent: () => <BookSkeleton />,
})}
/>
);
} as ModeledVoidComponent<BookModel>;
ConditionalComponentComponent that renders different components depending on a provided condition.
ModelView propertiescondition - Value that determines which component to render.components - A map pairing a condition to its respective component.FallbackComponent - Component to render when provided condition does not map to
any component, or is invalid.const BookRepository = function({ model }) {
const { bookModels, condition } = model.modelView;
const { interact } = model.interact;
const SuccessComponent = () => (
<div className='books-container'>
<ComponentList
model={
modelView: {
componentModels: bookModels,
Component: Book,
}
}
/>
</div>
);
return (
<>
<ConditionalComponent
model={newReadonlyModel({
condition: condition,
components: new Map([
["success", SuccessComponent],
["pending", () => <PendingSkeleton />],
["failed", () => <FailedSkeleton />]
]),
FallbackComponent: () => <></>,
})}
/>
<button onClick={interact({"Refresh Models"})}>Refresh</button>
</>
);
} as ModeledVoidComponent<BookRepositoryModel>
FAQs
Framework for developing MVC-based React components
The npm package @mvc-react/components receives a total of 2 weekly downloads. As such, @mvc-react/components popularity was classified as not popular.
We found that @mvc-react/components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.