DEV Community

Discussion on: React vs Signals: 10 Years Later

Collapse
 
redbar0n profile image
Magne Playful Programming

This reminds me of React's relation to MVC. stackoverflow.com/a/65969849/380607

Here's the gist of the headlines from that answer:

React is not considered to be MVC. Since Facebook inaccurately contrasted Flux with MVC.

Flux is not in direct opposition to MVC per se, but in opposition to mutability and two-way data-binding, something which MVC does not specify (but which people typically allowed when using MVC).

Stateless MVC also didn't fit on the client-side.

But React is MVC, in some sense. Components are ViewControllers, typically. Components as Views, Hooks as Controllers.

Alternatively, you could treat Components as pure Views (as originally intended?), and have a separate Model-Controller:
github.com/statelyai/xstate/discus...

Collapse
 
mfp22 profile image
Mike Pearson Playful Programming

Sounds like you're copying my own writing back to me but with strange twists
Image description

Controllers "control" things, so it's the event handlers with imperative state-controlling statements that are the controllers.

Thread Thread
 
redbar0n profile image
Magne Playful Programming

Indeed, and the event handlers could be modeled in XState, like in my gist. It’s basically vertically sliced MVC-widgets, instead of having MVC as a horizontal layer based on technology.