From React to Vue throught the mind of React developer

February 22, 2020

I've been using React full time on my job and for personal projects since 2017. I have used Vue for smaller personal and client projects mostly before 2017. But now I've changed companies and our codebase is using Vue, so I'll write about my gotchas and general experience while doing this switch mentally and in code.

First big mental switch is from React's immutability to Vue's reactivity. Just few days ago I found myself writing this line to add items to an array 😄

items = [...items, newItem]

instead of

items.push(newItem)

So this is something that probably will take time adjusting to. Actually understanding immutability may come handy in some cases: https://vuejs.org/v2/guide/list.html#Caveats