View Transitions and Activity: React Just Made My Life Easier

Amaan Raza Majidi

React just dropped some heat with View Transitions and Activity APIs, and I'm here for it. When I saw their latest blog post, I had to dig in. Here's my take: Activity might kill URL params for state hacks, and View Transitions are slicker than most animation libraries I've messed with.

View Transitions: Animations That Don't Suck

First up, View Transitions. React's basically saying, "Forget JS for animations and let the browser handle it." You wrap stuff in <ViewTransition>, trigger it with startTransition or Suspense, and style it with CSS. Their video list demo animating a thumbnail to a full view was clean. Shared element transitions are the real flex: <ViewTransition name={id}> lets you animate an element from one spot to another. Think thumbnail in a list morphing into a detail page header, smoooth.

I'm already thinking about using this for navigation flows. The browser native animations mean performance isn't a dumpster fire, which is a win. The catch? It's experimental, so the API might break. Also, you gotta learn CSS pseudo-selectors like ::view-transition-old. Not a dealbreaker, but if you're a JS animation nerd, it's a shift. Still, this is the kind of stuff that makes apps feel polished without breaking a sweat so count me in.

Activity: URL Params Can Take a Hike

Now, Activity, this one's a game-changer. <Activity mode="hidden"> lets you hide UI parts without losing state. React's example of preserving a search filter across navigation hit me hard. I've fought state loss battles before: filters resetting when users navigate away is a pain. The usual fix is URL params (?filter=pending), but parsing that on every load is a mess. Activity keeps the component alive in memory, state and all, without unmounting. No query string nonsense, no localStorage hacks, just works.

This might kill URL params for state hacks. Why clog the URL with ?search=term when Activity can keep your filter input alive? It's cleaner and faster. Sure, Activity's not perfect, there's no mode for modals yet (React says they're working on it), and if you need deep linking for sharing, URL params still win. But for ephemeral stuff like form inputs? Activity's the move. I'm sold.

Wrapping Up

React's new APIs are wild—View Transitions make animations stupid easy, and Activity might end my URL param nightmares. They're experimental, so they might break, but that's half the fun. React's handing us tools to build smoother, smarter apps, can't wait to mess with them.