react is not an mvvm framework, but React can be used as the second V in MVVM, which is View; a distinctive feature of MVVM is two-way binding, while React is one-way data binding; react as a whole is functional The idea is to design the component as a pure component, and the state and logic are passed in through parameters.
Recommended: "react video tutorial"
react is a tool launched by Facebook to build user interfaces JavaScript library. React is mainly used to build UI. Many people think of React as the V (view) in MVC. React has high performance and very simple code logic. More and more people have begun to pay attention to and use it.
React can be used as the second V in MVVM, which is View, but it is not an MVVM framework.
One of the most significant features of MVVM: two-way binding.
React does not have this, it is one-way data binding.
React is a one-way data flow library with state-driven views.
React as a whole is based on functional thinking. Components are designed as pure components, and state and logic are passed in through parameters. Therefore, in react, there is a one-way data flow. It is recommended to combine immutable to achieve data immutability.
The above is the detailed content of Is react an mvvm framework?. For more information, please follow other related articles on the PHP Chinese website!