DEV Community

loading...

Don't you think react is like MVC

Saurabh Sharma
Web development React.js GraphQL Typescript JavaScript Design SEO
・1 min read

With custom hooks and even in Container and Presentational components Architecture It seems just like controller and views.

Thoughts?

Discussion (1)

Collapse
gsto profile image
Glenn Stovall

I could see how that mental model works. You could also think of it as a model-view-viewmodel pattern, where your presentation components are your views, and your container components are your viewmodels. In either that example or your own, I'd imagine that Redux, RxJS, or some other service acts as your "model" in this case.

Having said that, It's not entirely correct to say React is "like" MVC. It could support an MVC-like pattern, but you aren't bound to it. React can support a number of design patterns. Depending on who you ask, that's one of its biggest strengths or most glaring weaknesses.