Gang Chao
Gang Chao

Reputation: 51

Is React MVVM framework?

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.

Upvotes: 5

Views: 6831

Answers (2)

Wenfang Du
Wenfang Du

Reputation: 11397

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.

Upvotes: 0

Jackkobec
Jackkobec

Reputation: 6745

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

Upvotes: 3

Related Questions