aboutexperienceprojectscontactblog

React Enhancements I Discovered in 2024

2 min read
By William Salas
ReactNext.jsTypeScriptWeb Development

Exploring React Server Components, Server Actions, and new hooks that changed how I build modern web applications.

React has evolved significantly in 2024, introducing features that fundamentally changed how I approach frontend development. Here are the enhancements that have had the biggest impact on my workflow.

React Server Components

Server Components (RSC) represent a paradigm shift in React development. By rendering components on the server, we can:

  • Keep large dependencies out of the client bundle
  • Access backend resources directly
  • Reduce JavaScript sent to the browser
// This runs only on the server
async function BlogPost({ id }) {
  const post = await db.post.findUnique({ where: { id } });
  return <article>{post.content}</article>;
}

The key insight is that server components can't use hooks or event handlers—they're for rendering, not interactivity.

React Server Actions

Server Actions simplified form handling dramatically. No more manual API routes:

async function updateProfile(formData: FormData) {
  'use server';
  const name = formData.get('name');
  await db.user.update({ where: { id }, data: { name } });
}

Combined with React 19's enhanced form handling, this creates a seamless developer experience.

Improved TypeScript Support

TypeScript integration has improved significantly:

  • Better inference for useTransition and useDeferredValue
  • More accurate types for event handlers
  • Improved support for generics in component props

useOptimistic Hook

This hook enables optimistic UI updates without complex state management:

const [optimisticMessages, addOptimistic] = useOptimistic(
  messages,
  (state, newMessage) => [...state, { ...newMessage, sending: true }]
);

The UI stays responsive while mutations happen in the background.

Conclusion

These enhancements make React apps more performant and developer-friendly. Server Components and Server Actions, in particular, enable full-stack development without leaving the React ecosystem.

The key is knowing when to use each feature—server components for data fetching, client components for interactivity, and Server Actions for mutations.