Opens profile photo
Follow
Click to Follow reactjs
React
@reactjs
React is a JavaScript library for building user interfaces.
reactjs.orgJoined July 2013

React’s Tweets

We're happy to see Server Components ship in today, and we've been in active talks with other frameworks like as part of the RSC working group, so look forward to seeing support in more frameworks soon. :)
1
99
Show this thread
React will keep working on the client just like it does today, but this will be a new lever available to everyone to build faster apps – by reducing bytes sent and streaming data as soon as it's ready.
1
70
Show this thread
This new React app architecture is inspired by optimizations in the most-used apps on the planet; it uses the server and client each for what they're best at, so pages are fully interactive with less JS – and with a great, consistent dev experience across both server and client.
1
29
Show this thread
In Dec 2020, we shared an initial preview of our work on Server Components. We often test new React features with teams at ; this time we also collaborated with other industry partners who volunteered including and .
Quote Tweet
As 2020 comes to an end we wanted to share a special Holiday Update on our research into zero-bundle-size React Server Components. The demo is available now whether you want to play with it during the holiday, or when work picks back up in the new year. reactjs.org/server-compone
Show this thread
Data Fetching with Server Components
1
28
Show this thread
Excited to see the release today of Next.js 13, which includes beta support for React Server Components as part of the React architecture!
Quote Tweet
Next.js 13 ◆ Layouts ◆ React Server Components w/ Streaming ◆ Component-based Data Fetching & Caching ◆ Turbopack: the Rust-based Webpack successor ◆ Improved `next/image` ◆ @next/font nextjs.org/13
4
978
Show this thread
What features do you feel are missing in React DevTools? What problems do you struggle with while debugging React? The React DevTools team love to know! 😍 Please reply with your ideas! 👇🥺
63
285
While any breaking changes to types are unfortunate, the point of using TypeScript is to catch more errors before they get to production. The changes in the React 18 typings go a long way towards catching issues that were previously silently ignored and caused crashes.
2
97
Show this thread
To clarify, this is a temporary upgrade suggestion to give the ecosystem maintainers time to update the libraries and code examples. The sooner you can add <StrictMode> back, the better!
Quote Tweet
Replying to @ralex1993 @TkDodo and @sreekar339
We do think it should <StrictMode> ideally be around the whole tree. The messaging about that has not changed. There is a temporary period where libraries aren’t compatible yet but you might want to start using 18. But we do expect you to add it back.
56
Show this thread
A small detail, but one that folks using server-side rendering might appreciate. React 18 adds an onRecoverableError callback to hydrateRoot so you can get notified about hydration mismatches in production. Helps find regressions!
Quote Tweet
Hidden gem in react 18: onRecoverableError configuration option for hydrateRoot. Tacking hydration related errors separately really helped to declutter my sentry issue log.
5
209
“React decides when to bounce” is a neat way to put it. 😌
Quote Tweet
Day 17 of #100DaysOfCode | @reactjs 18! React 18 is out and it's huge! 🥳 Played around with useId and useDeferredValue. useDeferredValue kind of acts like debounce but React decides when to bounce! Really cool stuff! Those new hooks will be great for library maintainers!
2
161
Suspense also enables selective hydration. React 18 can start hydrating the HTML before all JavaScript code loads. Specifically, content wrapped in <Suspense> will not block the rest of the page from hydrating! If you start interacting, React will prioritize hydrating that area.
An illustration of clicking on a new story, and only seeing its parents hydrated (but not their siblings)
1
168
Show this thread
This means that a single slow data source on the server will no longer hold the entire page back. The user will gradually see more content as soon as it becomes available. This works before any of the JavaScript code loads on the client! It also lets hydration start much earlier.
1
209
Show this thread
If you wait for some data to load on the server, React can now stream HTML for the fallback (for example, a spinner) and let the user see the rest of the page. When the data is ready, React sends the content HTML along with a <script> tag to insert it into the right place.
A diagram of an app with a spinner in the content section
3
362
Show this thread
React 18 includes two big improvements for server-rendered apps. Both of these improvements are unlocked by a single Suspense API. On the server, Suspense enables progressively streaming HTML. On the client, Suspense enables selective hydration. What does this mean? 🤔
<Suspense fallback={<Spinner />}>
  <Comments />
</Suspense>
3
297
Show this thread
React 18 also adds Transitions. Transitions let you split a state update into an urgent part (for example, updating the input) and a transition (for example, changing the content of a list). Transitions are interruptible, don’t block user input, and keep your app more responsive.
import {startTransition} from 'react';

// Urgent: Show what was typed
setInputValue(input);

// Mark any state updates inside as transitions
startTransition(() => {
  // Transition: Show the results
  setSearchQuery(input);
});
3
375
Show this thread
React 18 adds automatic batching. Batching is when React combines multiple setState() calls into a single re-render to improve performance. Previously, React only batched updates inside event handlers. In React 18, more updates are batched by default, improving performance.
// Before: only React events were batched.
setTimeout(() => {
  setCount(c => c + 1);
  setFlag(f => !f);
  // React will render twice, once for each state update (no batching)
}, 1000);

// After: updates inside of timeouts, promises,
// native event handlers or any other event are batched.`
setTimeout(() => {
  setCount(c => c + 1);
  setFlag(f => !f);
  // React will only re-render once at the end (that's batching!)
}, 1000);
5
472
Show this thread
Many of the features in React 18 use concurrent rendering — a behind-the-scenes change that unlocks powerful new capabilities. Thanks to the community feedback, Concurrent React is opt-in. It’s only enabled when you use a concurrent feature.
1
222
Show this thread
Our latest major version includes out-of-the-box improvements like automatic batching, new APIs like startTransition, and streaming server-side rendering with support for Suspense.
4
303
Show this thread
Last but not the least, this RFC describes a new mechanism in React 18 that lets your app automatically recover from server rendering errors. React would use the same mechanism to safely re-render a part of the tree whenever there is a hydration mismatch.
69
Show this thread
We’re very thankful to everyone who has contributed to this release, with special thanks to the members of the React 18 Working Group and the people who reported issues. This release has been long in the making, and we can’t wait to build new features unlocked by React 18. 💙
1
87
Show this thread
If you want to provide feedback on the APIs we are planning to release in React 18, we’d love to hear from you on the RFC threads! As always, after React 18 is out, we will update the documentation and post a summary of the changes on our blog. 👀
1
60
Show this thread