Get ready, ReactJS enthusiasts! We’re here to share some awesome news directly from the React official blog. In this post, we’ll talk about the latest and coolest things happening in ReactJS that are about to change how we create user interfaces
React Compiler:
- No longer a research project, the compiler now powers Instagram in production.
- Team aims to ship the compiler to other Meta surfaces and prepare for open-source release.
- The compiler aims to eliminate the need for manual memoization by automatically optimizing re-renders based on state changes.
- The compiler adheres to strict React rules to ensure safe and predictable code transformations.
Actions:
- Actions offer a unified way to handle data submissions from client to server.
- Define actions on the client or server with use client and use server directives.
- Access form state and response with
useFormStatus
anduseFormState
. - Utilize
useOptimistic
for temporary UI updates while data is processed. - Actions are available in the React Canary channel and will be released soon.
New Features in React Canary:
- React Server Components (RSC): Render components directly on the server for SEO and performance benefits.
- Asset Loading: Suspense now handles loading of stylesheets, fonts, and scripts.
- Document Metadata: Built-in support for rendering
<title>
,<meta>
, and<link>
tags. - These features are ready for production use in Canary, but will be part of React 19 due to their interdependence.
The Next Major Version of React:
- React 19 is coming! Includes all the features mentioned above, plus long-awaited improvements like Web Components support.
- Breaking changes are expected due to new features like Asset Loading.
- More information and release timeline coming soon.
Activity (formerly Offscreen):
- Research on a feature for managing active and inactive parts of the UI.
- Temporarily deprioritized while focusing on other features.
Key points summarized:
- React Compiler is moving towards open source and production use.
- Actions simplify data handling and form management.
- React Canary offers early access to new features like RSC and Asset Loading.
- React 19 brings major improvements and breaking changes.
- Activity research continues, focusing on other features first.
Thanks for being part of this read, and for more updates you can join upcoming React Conf (May 15-16 2024).