Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9a370f2
[compiler] Tweak intro section on manual memo guidance (#7953)
poteto Aug 28, 2025
94a1164
[compiler][ez] Reference rc tag for install instructions (#7955)
poteto Aug 28, 2025
19c8201
[compiler] Update docs on eslint-plugin-react-hooks installation (#7956)
poteto Aug 28, 2025
2774ddf
Add reload button, rename reset to clear (#7954)
rickhanlonii Aug 29, 2025
ddfcf6e
fix: typo in component style documentation (#7925)
sky21kr Sep 1, 2025
bb998fd
fix broken link server-functions (#7923)
PouriaDamavandi Sep 1, 2025
4db5ecd
docs: Add Rendercon 2025 Conference (#7962)
orama254 Sep 2, 2025
9ced885
feat(i18n): make DocsPageFooter navigation labels translatable (#7943)
mrbadri Sep 2, 2025
04feec4
fix(rtl): resolve RTL issues in Challenges component (#7942)
mrbadri Sep 2, 2025
4d53629
Introduce Liverpool and Edinburgh meetup groups. (#7950)
asimno Sep 2, 2025
73a5fdd
docs: fix typo in update useTransition.md (#7936)
brookslybrand Sep 2, 2025
fc27b0a
docs: fix ordered list numbering in TypeScript with React Components …
mrbadri Sep 2, 2025
03a5465
Docs: update ref callback behaviour (#7927)
ninamma Sep 2, 2025
a4a37d8
Add setup to home sidebar (#7963)
rickhanlonii Sep 2, 2025
ca3e271
fix: definition typo on view transitions blog post (#7918)
vitormrmonteiro Sep 2, 2025
67584b3
Fix: grammar and add comma (#7917)
deepu7ds Sep 2, 2025
0cc37ee
fix: typo (#7914)
Raghuboi Sep 2, 2025
afd84d1
Recommend installing `@types/*` as dev dependencies
Dejumo Sep 2, 2025
337d5ea
docs: minor grammar correction (#7906)
ergusto Sep 2, 2025
e9efd19
fix : typo in form component documentation (#7894)
developerjhp Sep 2, 2025
2217f45
Update "Deep Dive" in reusing-logic-with-custom-hooks.md with link an…
aurorascharff Sep 2, 2025
ff11cd2
Add note that form actions are actions (#7964)
rickhanlonii Sep 2, 2025
85ee6b2
Remove deprecated loremflickr placeholder images (#7968)
poteto Sep 3, 2025
b8e9faf
Fix handleClick compiler intro example (#7967)
rickhanlonii Sep 3, 2025
d34c6a2
Fix/tictactoe docs invalid file names (#7969)
mtayyabrawan Sep 4, 2025
4d3d495
Add React Conf 2024 to /videos (#7977)
rickhanlonii Sep 9, 2025
0bfd418
docs: add flushSync Troubleshooting section (#7978)
Akshay090 Sep 11, 2025
d8c58e3
docs(en): merging all conflicts
docschina-bot Sep 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Binary file modified public/images/tutorial/react-starter-code-codesandbox.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/DocsFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function FooterLink({
/>
<div className="flex flex-col overflow-hidden">
<span className="text-sm font-bold tracking-wide no-underline uppercase text-secondary dark:text-secondary-dark group-focus:text-link dark:group-focus:text-link-dark group-focus:text-opacity-100">
{type}
{type === 'Previous' ? 'Previous' : 'Next'}
</span>
<span className="text-lg break-words group-hover:underline">
{title}
Expand Down
1 change: 1 addition & 0 deletions src/components/Icon/IconArrowSmall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const IconArrowSmall = memo<
const classes = cn(className, {
'rotate-180': displayDirection === 'left',
'rotate-180 rtl:rotate-0': displayDirection === 'start',
'rtl:rotate-180': displayDirection === 'end',
'rotate-90': displayDirection === 'down',
});
return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/MDX/Challenges/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function Navigation({
onClick={handleScrollLeft}
aria-label="Scroll left"
className={cn(
'bg-secondary-button dark:bg-secondary-button-dark h-8 px-2 rounded-l border-gray-20 border-r rtl:rotate-180',
'bg-secondary-button dark:bg-secondary-button-dark h-8 px-2 rounded-l rtl:rounded-r rtl:rounded-l-none border-gray-20 border-r rtl:border-l rtl:border-r-0',
{
'text-primary dark:text-primary-dark': canScrollLeft,
'text-gray-30': !canScrollLeft,
Expand All @@ -120,7 +120,7 @@ export function Navigation({
onClick={handleScrollRight}
aria-label="Scroll right"
className={cn(
'bg-secondary-button dark:bg-secondary-button-dark h-8 px-2 rounded-e rtl:rotate-180',
'bg-secondary-button dark:bg-secondary-button-dark h-8 px-2 rounded-e',
{
'text-primary dark:text-primary-dark': canScrollRight,
'text-gray-30': !canScrollRight,
Expand Down
22 changes: 22 additions & 0 deletions src/components/MDX/Sandpack/ClearButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/

import * as React from 'react';
import {IconClose} from '../../Icon/IconClose';
export interface ClearButtonProps {
onClear: () => void;
}

export function ClearButton({onClear}: ClearButtonProps) {
return (
<button
className="text-sm text-primary dark:text-primary-dark inline-flex items-center hover:text-link duration-100 ease-in transition mx-1"
onClick={onClear}
title="Clear all edits and reload sandbox"
type="button">
<IconClose className="inline mx-1 relative" />
<span className="hidden md:block">Clear</span>
</button>
);
}
16 changes: 9 additions & 7 deletions src/components/MDX/Sandpack/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import {
useSandpackNavigation,
} from '@codesandbox/sandpack-react/unstyled';
import {OpenInCodeSandboxButton} from './OpenInCodeSandboxButton';
import {ResetButton} from './ResetButton';
import {ReloadButton} from './ReloadButton';
import {ClearButton} from './ClearButton';
import {DownloadButton} from './DownloadButton';
import {IconChevron} from '../../Icon/IconChevron';
import {Listbox} from '@headlessui/react';
Expand Down Expand Up @@ -95,21 +96,21 @@ export function NavigationBar({providedFiles}: {providedFiles: Array<string>}) {
// Note: in a real useEvent, onContainerResize would be omitted.
}, [isMultiFile, onContainerResize]);

const handleReset = () => {
const handleClear = () => {
/**
* resetAllFiles must come first, otherwise
* the previous content will appear for a second
* when the iframe loads.
*
* Plus, it should only prompt if there's any file changes
*/
if (
sandpack.editorState === 'dirty' &&
confirm('Reset all your edits too?')
) {
if (sandpack.editorState === 'dirty' && confirm('Clear all your edits?')) {
sandpack.resetAllFiles();
}
refresh();
};

const handleReload = () => {
refresh();
};

Expand Down Expand Up @@ -188,7 +189,8 @@ export function NavigationBar({providedFiles}: {providedFiles: Array<string>}) {
className="px-3 flex items-center justify-end text-start"
translate="yes">
<DownloadButton providedFiles={providedFiles} />
<ResetButton onReset={handleReset} />
<ReloadButton onReload={handleReload} />
<ClearButton onClear={handleClear} />
<OpenInCodeSandboxButton />
{activeFile.endsWith('.tsx') && (
<OpenInTypeScriptPlaygroundButton
Expand Down
26 changes: 26 additions & 0 deletions src/components/MDX/Sandpack/ReloadButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/

import * as React from 'react';
import {IconRestart} from '../../Icon/IconRestart';
export interface ReloadButtonProps {
onReload: () => void;
}

export function ReloadButton({onReload}: ReloadButtonProps) {
return (
<button
className="text-sm text-primary dark:text-primary-dark inline-flex items-center hover:text-link duration-100 ease-in transition mx-1"
onClick={onReload}
title="Keep your edits and reload sandbox"
type="button">
<<<<<<< HEAD:src/components/MDX/Sandpack/ResetButton.tsx
<IconRestart className="inline mx-1 relative" /> 重置
=======
<IconRestart className="inline mx-1 relative" />
<span className="hidden md:block">Reload</span>
>>>>>>> 0bfd418252167fc7cce16452ae319e1071498ccc:src/components/MDX/Sandpack/ReloadButton.tsx
</button>
);
}
21 changes: 0 additions & 21 deletions src/components/MDX/Sandpack/ResetButton.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions src/content/blog/2025/04/21/react-compiler-rc.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,23 @@ During the RC period, we encourage all React users to try the compiler and provi
As noted in the Beta announcement, React Compiler is compatible with React 17 and up. If you are not yet on React 19, you can use React Compiler by specifying a minimum target in your compiler config, and adding `react-compiler-runtime` as a dependency. You can find docs on this [here](https://react.dev/learn/react-compiler#using-react-compiler-with-react-17-or-18).

## Migrating from eslint-plugin-react-compiler to eslint-plugin-react-hooks {/*migrating-from-eslint-plugin-react-compiler-to-eslint-plugin-react-hooks*/}
If you have already installed eslint-plugin-react-compiler, you can now remove it and use `eslint-plugin-react-hooks@6.0.0-rc.1`. Many thanks to [@michaelfaith](https://bsky.app/profile/michael.faith) for contributing to this improvement!
If you have already installed eslint-plugin-react-compiler, you can now remove it and use `eslint-plugin-react-hooks@rc`. Many thanks to [@michaelfaith](https://bsky.app/profile/michael.faith) for contributing to this improvement!

To install:

npm
<TerminalBlock>
{`npm install --save-dev eslint-plugin-react-hooks@6.0.0-rc.1`}
{`npm install --save-dev eslint-plugin-react-hooks@rc`}
</TerminalBlock>

pnpm
<TerminalBlock>
{`pnpm add --save-dev eslint-plugin-react-hooks@6.0.0-rc.1`}
{`pnpm add --save-dev eslint-plugin-react-hooks@rc`}
</TerminalBlock>

yarn
<TerminalBlock>
{`yarn add --dev eslint-plugin-react-hooks@6.0.0-rc.1`}
{`yarn add --dev eslint-plugin-react-hooks@rc`}
</TerminalBlock>

```js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2521,7 +2521,7 @@ export default function App() {
const { url } = useRouter();

// Define a default animation of .slow-fade.
// See animations.css for the animation definiton.
// See animations.css for the animation definition.
return (
<ViewTransition default="slow-fade">
{url === '/' ? <Home /> : <Details />}
Expand Down
5 changes: 5 additions & 0 deletions src/content/community/conferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ October 2-4, 2025. Alicante, Spain.

[Website](https://reactalicante.es/) - [Twitter](https://x.com/ReactAlicante) - [Bluesky](https://bsky.app/profile/reactalicante.es) - [YouTube](https://www.youtube.com/channel/UCaSdUaITU1Cz6PvC97A7e0w)

### RenderCon Kenya 2025 {/*rendercon-kenya-2025*/}
October 04, 2025. Nairobi, Kenya

[Website](https://rendercon.org/) - [Twitter](https://twitter.com/renderconke) - [LinkedIn](https://www.linkedin.com/company/renderconke/) - [YouTube](https://www.youtube.com/channel/UC0bCcG8gHUL4njDOpQGcMIA)

### React Conf 2025 {/*react-conf-2025*/}
October 7-8, 2025. Henderson, Nevada, USA and free livestream

Expand Down
4 changes: 4 additions & 0 deletions src/content/community/meetups.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
* [Manchester](https://www.meetup.com/Manchester-React-User-Group/)
* [React.JS Girls London](https://www.meetup.com/ReactJS-Girls-London/)
* [React Advanced London](https://guild.host/react-advanced-london)
* [React Native Liverpool](https://www.meetup.com/react-native-liverpool/)
* [React Native London](https://guild.host/RNLDN)

## Finland {/*finland*/}
Expand Down Expand Up @@ -137,6 +138,9 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
## Portugal {/*portugal*/}
* [Lisbon](https://www.meetup.com/JavaScript-Lisbon/)

## Scotland (UK) {/*scotland-uk*/}
* [Edinburgh](https://www.meetup.com/react-edinburgh/)

## Spain {/*spain*/}
* [Barcelona](https://www.meetup.com/ReactJS-Barcelona/)

Expand Down
83 changes: 76 additions & 7 deletions src/content/community/videos.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,75 @@ Videos dedicated to the discussion of React and the React ecosystem.

</Intro>

## React Conf 2024 {/*react-conf-2024*/}

At React Conf 2024, Meta CTO [Andrew "Boz" Bosworth](https://www.threads.net/@boztank) shared a welcome message to kick off the conference:

<YouTubeIframe src="https://www.youtube.com/embed/T8TZQ6k4SLE?t=975s" title="Boz and Seth Intro" />

### React 19 Keynote {/*react-19-keynote*/}

In the Day 1 keynote, we shared vision for React starting with React 19 and the React Compiler. Watch the full keynote from [Joe Savona](https://twitter.com/en_JS), [Lauren Tan](https://twitter.com/potetotes), [Andrew Clark](https://twitter.com/acdlite), [Josh Story](https://twitter.com/joshcstory), [Sathya Gunasekaran](https://twitter.com/_gsathya), and [Mofei Zhang](https://twitter.com/zmofei):


<YouTubeIframe src="https://www.youtube.com/embed/lyEKhv8-3n0" title="YouTube video player" />

### React Unpacked: A Roadmap to React 19 {/*react-unpacked-a-roadmap-to-react-19*/}

React 19 introduced new features including Actions, `use()`, `useOptimistic` and more. For a deep dive on using new features in React 19, see [Sam Selikoff's](https://twitter.com/samselikoff) talk:

<YouTubeIframe src="https://www.youtube.com/embed/R0B2HsSM78s" title="React Unpacked: A Roadmap to React 19" />

### What's New in React 19 {/*whats-new-in-react-19*/}

[Lydia Hallie](https://twitter.com/lydiahallie) gave a visual deep dive of React 19's new features:

<YouTubeIframe src="https://www.youtube.com/embed/AJOGzVygGcY" title="What's New in React 19" />

### React 19 Deep Dive: Coordinating HTML {/*react-19-deep-dive-coordinating-html*/}

[Josh Story](https://twitter.com/joshcstory) provided a deep dive on the document and resource streaming APIs in React 19:

<YouTubeIframe src="https://www.youtube.com/embed/IBBN-s77YSI" title="React 19 Deep Dive: Coordinating HTML" />

### React for Two Computers {/*react-for-two-computers*/}

[Dan Abramov](https://bsky.app/profile/danabra.mov) imagined an alternate history where React started server-first:

<YouTubeIframe src="https://www.youtube.com/embed/ozI4V_29fj4" title="React for Two Computers" />

### Forget About Memo {/*forget-about-memo*/}

[Lauren Tan](https://twitter.com/potetotes) gave a talk on using the React Compiler in practice:

<YouTubeIframe src="https://www.youtube.com/embed/lvhPq5chokM" title="Forget About Memo" />

### React Compiler Deep Dive {/*react-compiler-deep-dive*/}

[Sathya Gunasekaran](https://twitter.com/_gsathya) and [Mofei Zhang](https://twitter.com/zmofei) provided a deep dive on how the React Compiler works:

<YouTubeIframe src="https://www.youtube.com/embed/uA_PVyZP7AI" title="React Compiler Deep Dive" />

### And more... {/*and-more-2024*/}

**We also heard talks from the community on Server Components:**
* [Enhancing Forms with React Server Components](https://www.youtube.com/embed/0ckOUBiuxVY&t=25280s) by [Aurora Walberg Scharff](https://twitter.com/aurorascharff)
* [And Now You Understand React Server Components](https://www.youtube.com/embed/pOo7x8OiAec) by [Kent C. Dodds](https://twitter.com/kentcdodds)
* [Real-time Server Components](https://www.youtube.com/embed/6sMANTHWtLM) by [Sunil Pai](https://twitter.com/threepointone)

**Talks from React frameworks using new features:**

* [Vanilla React](https://www.youtube.com/embed/ZcwA0xt8FlQ) by [Ryan Florence](https://twitter.com/ryanflorence)
* [React Rhythm & Blues](https://www.youtube.com/embed/rs9X5MjvC4s) by [Lee Robinson](https://twitter.com/leeerob)
* [RedwoodJS, now with React Server Components](https://www.youtube.com/embed/sjyY4MTECUU) by [Amy Dutton](https://twitter.com/selfteachme)
* [Introducing Universal React Server Components in Expo Router](https://www.youtube.com/embed/djhEgxQf3Kw) by [Evan Bacon](https://twitter.com/Baconbrix)

**And Q&As with the React and React Native teams:**
- [React Q&A](https://www.youtube.com/embed/T8TZQ6k4SLE&t=27518s) hosted by [Michael Chan](https://twitter.com/chantastic)
- [React Native Q&A](https://www.youtube.com/embed/0ckOUBiuxVY&t=27935s) hosted by [Jamon Holmgren](https://twitter.com/jamonholmgren)

You can watch all of the talks at React Conf 2024 at [conf2024.react.dev](https://conf2024.react.dev/talks).

## React Conf 2021 {/*react-conf-2021*/}

### React 18 Keynote {/*react-18-keynote*/}
Expand All @@ -16,13 +85,13 @@ In the keynote, we shared our vision for the future of React starting with React

Watch the full keynote from [Andrew Clark](https://twitter.com/acdlite), [Juan Tejada](https://twitter.com/_jstejada), [Lauren Tan](https://twitter.com/potetotes), and [Rick Hanlon](https://twitter.com/rickhanlonii) here:

<YouTubeIframe src="https://www.youtube.com/embed/FZ0cG47msEk" title="YouTube video player" />
<YouTubeIframe src="https://www.youtube.com/embed/FZ0cG47msEk" title="React 18 Keynote" />

### React 18 for Application Developers {/*react-18-for-application-developers*/}

For a demo of upgrading to React 18, see [Shruti Kapoor](https://twitter.com/shrutikapoor08)’s talk here:

<YouTubeIframe src="https://www.youtube.com/embed/ytudH8je5ko" title="YouTube video player" />
<YouTubeIframe src="https://www.youtube.com/embed/ytudH8je5ko" title="React 18 for Application Developers" />

### Streaming Server Rendering with Suspense {/*streaming-server-rendering-with-suspense*/}

Expand All @@ -32,35 +101,35 @@ Streaming server rendering lets you generate HTML from React components on the s

For a deep dive, see [Shaundai Person](https://twitter.com/shaundai)’s talk here:

<YouTubeIframe src="https://www.youtube.com/embed/pj5N-Khihgc" title="YouTube video player" />
<YouTubeIframe src="https://www.youtube.com/embed/pj5N-Khihgc" title="Streaming Server Rendering with Suspense" />

### The first React working group {/*the-first-react-working-group*/}

For React 18, we created our first Working Group to collaborate with a panel of experts, developers, library maintainers, and educators. Together we worked to create our gradual adoption strategy and refine new APIs such as `useId`, `useSyncExternalStore`, and `useInsertionEffect`.

For an overview of this work, see [Aakansha' Doshi](https://twitter.com/aakansha1216)'s talk:

<YouTubeIframe src="https://www.youtube.com/embed/qn7gRClrC9U" title="YouTube video player" />
<YouTubeIframe src="https://www.youtube.com/embed/qn7gRClrC9U" title="The first React working group" />

### React Developer Tooling {/*react-developer-tooling*/}

To support the new features in this release, we also announced the newly formed React DevTools team and a new Timeline Profiler to help developers debug their React apps.

For more information and a demo of new DevTools features, see [Brian Vaughn](https://twitter.com/brian_d_vaughn)’s talk:

<YouTubeIframe src="https://www.youtube.com/embed/oxDfrke8rZg" title="YouTube video player" />
<YouTubeIframe src="https://www.youtube.com/embed/oxDfrke8rZg" title="React Developer Tooling" />

### React without memo {/*react-without-memo*/}

Looking further into the future, [Xuan Huang (黄玄)](https://twitter.com/Huxpro) shared an update from our React Labs research into an auto-memoizing compiler. Check out this talk for more information and a demo of the compiler prototype:

<YouTubeIframe src="https://www.youtube.com/embed/lGEMwh32soc" title="YouTube video player" />
<YouTubeIframe src="https://www.youtube.com/embed/lGEMwh32soc" title="React without memo" />

### React docs keynote {/*react-docs-keynote*/}

[Rachel Nabors](https://twitter.com/rachelnabors) kicked off a section of talks about learning and designing with React with a keynote about our investment in React's new docs ([now shipped as react.dev](/blog/2023/03/16/introducing-react-dev)):

<YouTubeIframe src="https://www.youtube.com/embed/mneDaMYOKP8" title="YouTube video player" />
<YouTubeIframe src="https://www.youtube.com/embed/mneDaMYOKP8" title="React docs keynote" />

### And more... {/*and-more*/}

Expand Down
4 changes: 4 additions & 0 deletions src/content/learn/build-a-react-app-from-scratch.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ React 生态系统中包含许多用于解决这些问题的工具。我们列

### 提高应用程序性能 {/*improving-application-performance*/}

<<<<<<< HEAD
由于你选择的构建工具仅支持单页应用程序(SPA),你需要实现其他 [渲染模式](https://www.patterns.dev/vanilla/rendering-patterns) 如服务器端渲染(SSR)、静态站点生成(SSG)和/或 React 服务器组件(RSC)。即使你一开始不需要这些功能,将来也可能有一些路由会从 SSR、SSG 或 RSC 中受益。
=======
Since the build tool you select only supports single page apps (SPAs), you'll need to implement other [rendering patterns](https://www.patterns.dev/vanilla/rendering-patterns) like server-side rendering (SSR), static site generation (SSG), and/or React Server Components (RSC). Even if you don't need these features at first, in the future there may be some routes that would benefit SSR, SSG or RSC.
>>>>>>> 0bfd418252167fc7cce16452ae319e1071498ccc

* **单页面应用程序 (SPA)** 加载单个 HTML 页面,并在用户与应用程序交互时动态更新页面。SPA 更容易入门,但初始加载时间可能较慢。SPA 是大多数构建工具的默认架构。

Expand Down
Loading
Loading