Skip to content

Vue ↔ React cheatsheet ​

Dense on purpose. When you blank on the name of the thing - come here.

Core ​

VueReact
SFC .vue.tsx function component
<template>JSX return (…)
<script setup>function body
ref(0)useState(0)
reactive({…})useState({…}) / multiple states
computed(() => x)derive in render: const x = …
watch / watchEffectuseEffect (carefully)
onMounteduseEffect(fn, [])
onUnmountedeffect cleanup return () => …
definePropsfunction args / props type
defineEmitscallback props onSomething
provide / injectContext
composable useXcustom hook useX
$slots / <slot>children / render props
v-if&& / ternary / early return
v-for.map()
:keykey
v-modelvalue + onChange
classclassName
style string/objectstyle object (camelCase)
template refuseRef + ref={…}

Routing ​

Vue RouterReact RouterNext App Router
RouterViewOutletchildren in layout.tsx
RouterLinkLinknext/link
useRoute()useParams / useLocationuseParams / params in page
router.pushnavigate()router.push (next/navigation)

State & data ​

Vue worldReact world
PiniaZustand (client)
fetch in PiniaTanStack Query (server state)
useFetch (Nuxt)RSC fetch / Query on client
Vuexplease don't start here 🙂

Testing ​

VueReact
Vue Test Utils / Testing LibraryTesting Library React
@vue/test-utils mountrender()
same Testing Library queriesscreen.getByRole(…)

Nuxt ↔ Next (short) ​

NuxtNext
pages/app/**/page.tsx
layouts/layout.tsx
middleware/middleware.ts
server routesapp/api/**/route.ts
modulespackages + your own glue

Keep this tab open for a week. Muscle memory shows up eventually.

-- ł.