4

I wrote a web application using React.js. When I went to the interview, I found that I couldn't explain the MVVM concept very well. At that time, I said, for example, in a component, M is state in react, V is jsx, and MV is an event operation to change state. So I said MVVM is reflected in react like this, and later they told me it wasn't MVVM. Don't say my question is so simple. I really can't figure it out.

Gang Chao
  • 41
  • 1
  • 2
  • 1
    Possible duplicate of [Why isn't React considered MVC?](https://stackoverflow.com/questions/53729411/why-isnt-react-considered-mvc) – Sachin Apr 24 '19 at 05:14
  • 2
    Please see this answer. It explains ReactJS and MVVM well. https://stackoverflow.com/questions/51506440/mvvm-architectural-pattern-for-a-reactjs-application – Zhiqiang Liu Sep 19 '19 at 10:15
  • 1
    Please see:[enter link description here](https://stackoverflow.com/questions/51506440/mvvm-architectural-pattern-for-a-reactjs-application). It explains ReactJS and MVVM pattern well. – Zhiqiang Liu Sep 19 '19 at 10:17

2 Answers2

3

When interviewer asked me about ReactJS I said that ReactJS is a view library.

Jackkobec
  • 5,889
  • 34
  • 34
0

Vue 3 (MVVM):

      Proxy       Update
  Model → ViewModel → View
  Model ← ViewModel ← View
      Update      Event

React:

     setState     Update
  Model → ViewModel → View
  Model ← ViewModel ← View
      Update      Event

The difference is only how the frameworks notify Model changes to the ViewModel.

Wenfang Du
  • 8,804
  • 9
  • 59
  • 90