3 ms·
Maybe it's best not to think of React as a View but a Component... You can create Components that are simple Views and render what they are given, you can also
by tracker1 8y ago
Maybe it's best not to think of React as a View but a Component... You can create Components that are simple Views and render what they are given, you can also create smarter Components that are more in line with Controllers.
As a loop: Store -> State -> Reducer -> Component -> Action -> Dispatch -> Store ...
Or if you want something closer to MVC, you could use MobX or similar.
- WorldMaker 8y agoI've been sold on JSX for a while, personally, and pretty much have that architecture in my apps I'm working on. I just also remember being an idealistic Django-loving youth that wanted the dumbest possible template engine to avoid teenage PHP drama, so I definitely sympathize with folks whose gut reaction is upset with JSX for crossing the streams (again), and thought to make sure it was clear that it isn't a straw man argument to many. (Even if it is also, as in my case, an argument that can be won in favor of JSX. Though also in my case one of the big factors winning that argument was TSX [Typescript type checking of JSX views] versus many of the alternatives and their [lack of] static checking/analysis.)