DEV Community

Saurabh Sharma
Saurabh Sharma

Posted on

Don't you think react is like MVC

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

Thoughts?

Top comments (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.