Reputation: 51
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
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
Reputation: 6745
When interviewer asked me about ReactJS I said that ReactJS is a view library.
Upvotes: 3