Skip to content

React · Vue

React Through a Vue/Nuxt Lens: Hooks, Composables and Where the Real Difference Is

I write mostly Vue and Nuxt in production and use React in personal projects. A conceptual mapping between the two helps in interviews and when switching, but the mapping can hide the real difference. Here is both the mapping and the difference.

01. The concept mapping

For someone coming from Vue most of React is a familiar thing under another name: ref ↔ useState, computed ↔ useMemo, watch/onMounted ↔ useEffect, composable ↔ custom hook, Pinia ↔ Zustand, Nuxt ↔ Next.js.

The mapping works on day one. The trap is reading every line as if it had an exact counterpart.

        // Vue 3
const count = ref(0)
const double = computed(() => count.value * 2)
watch(count, (v) => console.log(v))

// React
const [count, setCount] = useState(0)
const double = useMemo(() => count * 2, [count])
useEffect(() => { console.log(count) }, [count])
      

02. The real difference: the reactivity model

In Vue, when state changes, only the places that read that state update; Vue tracks which dependency is read where. In React, when state changes, the component re-runs from the top and React works out what changed by comparing. That is why React has dependency arrays, useMemo and useCallback; in Vue you mostly do not need them.

The second difference is immutability. In Vue state.items.push(x) works. In React the same thing does not trigger a render, you have to produce a new array ([...items, x]). The "React State & Immutability" post on this site is exactly that point.

03. Are composables and custom hooks the same?

Same goal: pull stateful logic out of the component and reuse it. But one runs once in setup, the other on every render. That is why hooks must be called unconditionally and in the same order (the Rules of Hooks); a composable has no such constraint.

        // Vue composable: runs once in setup
export function useCounter() {
  const count = ref(0)
  const inc = () => count.value++
  return { count, inc }
}

// React hook: runs on every render, call order must be stable
export function useCounter() {
  const [count, setCount] = useState(0)
  const inc = useCallback(() => setCount((c) => c + 1), [])
  return { count, inc }
}
      

The honest way to say this in an interview: "I am mostly Vue/Nuxt in production and have used React in personal projects; here is how I see where the logic differs." Knowing the mapping is not enough, knowing where it breaks is what builds trust.

04. The SSR side: Nuxt and Next

The idea is similar: render on the server, hydrate in the browser. The differences are in routing and data fetching. In Nuxt you use useAsyncData/useFetch inside the component; in Next (App Router) the server component itself is async. Hydration errors come from the same root in both: the server and the client produce different HTML.

If you're looking for a developer, have a question, or just want to connect, feel free to reach out to me.

You can also find me on these platforms!

© 2026 · Designed and coded by Ahmet Ali Gül