Technology - 4 Min Read Naveen Raina 16 Feb 2020
I have been using Vuejs for 5 years now and it remains my framework of choice. However I have been reading about React as it is the most popular SPA framework. I have also undertaken a project on React for a wealth management company. React has been used in a best possible manner in this project and it gave me a chance to see it in action. After spending good amount of time understanding how things are laid out in this project, I feel I can write some key points about React and how it is similar/different from Vuejs. Here are my few cents to this widely discussed topic –
Both the frameworks are quite similar in terms of project structure. If you understand Vuejs, you will never feel lost in a React project. Keep the same concepts in mind and you will find an alternate term in React.
Both frameworks use components and build pages through component hierarchy. Things like props, data, methods, events, component lifecycle events (mounted, created etc.) can be seen in a react component with slightly different terminology.
Both frameworks can use statement management which can be introduced through a plugin. While Vuex is used with Vue, Redux is popular in React. I found Redux a little complicated than Vuex. But both Vuex and Redux are similar in their design. Vuex uses terms like store, actions, getters and mutations. Redux has store, actions and reducers. So, you can relate a bit.
One thing that is different in these two frameworks is the way html is rendered. While Vuejs uses plain html, React uses JSX pre-processor. Since I have spent more time in Vuejs, I pretty much like the control and ease of writing html as compared to writing JSX. But JSX gives more control while debugging. So I am kind of liking JSX which gives me a chance to debug to the last bit where the component is going to be rendered (render function).
Apart from above three points, everything else remains quite same in both the frameworks. You can keep extending the project by adding open source libraries and React has tones of cool libraries out there. Vuejs seems to be catching up. I have not used testing frameworks in React yet so that is something that I will be checking out soon.