|
|
|
|
|
by madhadron
2318 days ago
|
|
React is just MVC turned inside out. The core principles still apply: 1. Any operation that changes the state the program is being used to manipulate should go to a single place and be fanned out to subscribers from there.
2. You want to be able to build compound views from simpler views and still treat them as the same kind of thing.
3. You want to be able to parameterize views over the behavior from interacting with them, e.g., you want to parameterize a button over what should happen when you press it, what its label should be, and if it is enabled. You can do strict MVC in JavaScript just fine (https://github.com/madhadron/mvc_for_the_web). React has one major win that MVC can't give you: if you have lots of teams all putting things onto the same page, React controls the refresh loop so one team's code can't keep updating and destroy the performance of the whole page. |
|