March 16, 2023  SEONews

Internationalization in Next.js 13 With React Server Components — Smashing Magazine


In this article, based on an example of a multilingual application displaying street photography images from Unsplash, Jan Amann explores next-intl to implement all internationalization needs in React Server Components and shares a technique for introducing interactivity with a minimalist client-side footprint.

With the introduction of Next.js 13 and the beta release of the App Router, React Server Components became publicly available. This new paradigm allows components that do not require React’s interactive features, such as useState and useEffectto stay on the server side only.

One area that benefits from this new capability is internationalization. Traditionally, internationalization requires a trade-off in performance, as loading translations results in larger client-side batches and using message parsers affects the client runtime performance of your program.

The promise of React Server Components is that we can have our cake and eat it too. If internationalization is implemented entirely on the server side, we can achieve new levels of performance for our applications, leaving the client side for interactive features. But how can we work with this paradigm when we need interactively controlled states to be reflected in internationalized messages?

In this article, we’ll explore a multilingual app that displays street photography images from Unsplash. We will use next-intl to implement all our internationalization needs in React Server Components, and we’ll look...



source: https://news.oneseocompany.com/2023/03/16/internationalization-in-next-js-13-with-react-server-components-smashing-magazine_2023031642140.html

Your content is great. However, if any of the content contained herein violates any rights of yours, including those of copyright, please contact us immediately by e-mail at media[@]kissrpr.com.