0:0026:19

What Next? The Future of React

Beth Swingler 26:19 2024

Pre-rendering a personalised React app can mean rendering twice and paying more

Next.js and Gatsby have become the default answer to building a fast new site, yet for apps full of user-specific data, static generation brings double rendering, hydration mismatches and a stream of server requests someone has to pay for. Beth Swingler, a senior software engineer at YLD who has specialised in React and React Native for over five years, asks when server rendering actually earns its keep.

Learn a simple test for choosing server components, static generation or plain client-side React

Watch on YouTube

In short

Beth Swingler, a senior software engineer at YLD, argues that static generation and server components in frameworks like Next.js are not a default win: their benefits depend on whether an app's data is static and shared or dynamic and user-specific. She offers a "shades of state" mental model for that decision and highlights React 19 features beyond server components, such as the new use hook and auto-memoization.

“So the conceptual model that I was referring to, which is kind of the main point of my talk, is we should look at the shades of state that we're dealing with.”
“So, yeah, like, for example, if you are only showing data to logged in users and the data is specific to them, then that is probably one of the worst times.”

What you will learn

  • Distinguish static, shared data from dynamic, user-specific data before choosing a rendering strategy.
  • Explain why hydration mismatches and double rendering happen when dynamic content is pre-rendered.
  • Weigh the hidden server and request costs of server-side rendering for frequently changing data.
  • Identify content types, such as blogs and shops, where static generation and caching pay off.
  • Apply React 19 features like the use hook and auto-memoization to cut boilerplate.

Key takeaways from the speaker

  • The technical, performance issues with server-side rendering frameworks like Next.JS
  • The hidden costs of server-side rendering
  • The benefits of doing less work on users' devices or web browsers

Details

Level
Intermediate
Format
Tech talk
Technical depth
Practitioner
For
Early career, Mid-career, Senior individual contributor
Length
26:19
Published
May 2024

Questions this talk answers

Is server-side rendering always faster than client-side React?

No. It depends on the size of the initial bundle and, above all, on how much of the content is dynamic and user-specific.

Why does pre-rendering dynamic content cause problems?

Content that depends on the user cannot be compiled in advance, so the app renders twice and the hydrated DOM can mismatch, causing flicker and delayed interactivity.

When is static generation a good choice?

When content is static or shared between users, such as blogs or shops whose listings rarely change, because it can be cached and served to everyone.

What are the hidden costs of server rendering?

Live, frequently changing data can trigger many requests to the server, which costs money, and workarounds for mismatches can force extra renders after mount.

What else in React 19 is worth learning beyond server components?

The new use hook, which replaces useState and useEffect boilerplate for async data and can be called conditionally, and the compiler's auto-memoization, which reduces useMemo and useCallback.

About this talk

React is dead. Long live React? 2024 sees the first new public version of React since April 2022. Is React 19 worth the wait? We now have server components and an auto-caching compiler, so claims that React.JS is dead seem to be greatly exaggerated. But are meta-frameworks, such as Next or Remix, still needed to get the best new features?

A deep dive into the latest shifts in the world's largest open-source JS framework, and what these changes mean for developers, servers, and the people paying for them.

Topics

Related talks

Browse the library

Flutter: What? Why? How? Where?

Anna Domashych Senior Mobile Engineer, Team Go, Inc.

Google Pay rewrote 1.7 million lines in Flutter and shrank its code by 35%

Beginner Software engineering and cloud 2021

Trends in Web Development

Pooja Malpani +3 Head of Engineering, Bloomberg Media

One panelist became a web developer without knowing any JavaScript

All levels Software engineering and cloud 2022

What Is NoSQL?

Heather Maga Business Owner / Software Developer, Copper Owl Development

In NoSQL, the database stops checking your data and the developer takes over

Beginner AI and data 2020