Skip to content

Commit 1817e28

Browse files
Merge branch 'main' of https://github.com/reactjs/react.dev into sync-a5181c29
2 parents ebdc8c3 + a5181c2 commit 1817e28

32 files changed

+492
-228
lines changed
16.3 KB
Loading

src/components/DocsFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function FooterLink({
8080
/>
8181
<div className="flex flex-col overflow-hidden">
8282
<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">
83-
{type}
83+
{type === 'Previous' ? 'Previous' : 'Next'}
8484
</span>
8585
<span className="text-lg break-words group-hover:underline">
8686
{title}

src/components/Icon/IconArrowSmall.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const IconArrowSmall = memo<
1919
const classes = cn(className, {
2020
'rotate-180': displayDirection === 'left',
2121
'rotate-180 rtl:rotate-0': displayDirection === 'start',
22+
'rtl:rotate-180': displayDirection === 'end',
2223
'rotate-90': displayDirection === 'down',
2324
});
2425
return (

src/components/Icon/IconExperimental.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {memo} from 'react';
66

77
export const IconExperimental = memo<
88
JSX.IntrinsicElements['svg'] & {title?: string; size?: 's' | 'md'}
9-
>(function IconCanary(
9+
>(function IconExperimental(
1010
{className, title, size} = {
1111
className: undefined,
1212
title: undefined,

src/components/MDX/Challenges/Navigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export function Navigation({
108108
onClick={handleScrollLeft}
109109
aria-label="Scroll left"
110110
className={cn(
111-
'bg-secondary-button dark:bg-secondary-button-dark h-8 px-2 rounded-l border-gray-20 border-r rtl:rotate-180',
111+
'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',
112112
{
113113
'text-primary dark:text-primary-dark': canScrollLeft,
114114
'text-gray-30': !canScrollLeft,
@@ -120,7 +120,7 @@ export function Navigation({
120120
onClick={handleScrollRight}
121121
aria-label="Scroll right"
122122
className={cn(
123-
'bg-secondary-button dark:bg-secondary-button-dark h-8 px-2 rounded-e rtl:rotate-180',
123+
'bg-secondary-button dark:bg-secondary-button-dark h-8 px-2 rounded-e',
124124
{
125125
'text-primary dark:text-primary-dark': canScrollRight,
126126
'text-gray-30': !canScrollRight,

src/components/MDX/MDXComponents.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {finishedTranslations} from 'utils/finishedTranslations';
3737

3838
import ErrorDecoder from './ErrorDecoder';
3939
import {IconCanary} from '../Icon/IconCanary';
40+
import {IconExperimental} from 'components/Icon/IconExperimental';
4041

4142
function CodeStep({children, step}: {children: any; step: number}) {
4243
return (
@@ -130,7 +131,7 @@ const ExperimentalBadge = ({title}: {title: string}) => (
130131
className={
131132
'text-base font-display px-1 py-0.5 font-bold bg-gray-10 dark:bg-gray-60 text-gray-60 dark:text-gray-10 rounded'
132133
}>
133-
<IconCanary
134+
<IconExperimental
134135
size="s"
135136
className={'inline me-1 mb-0.5 text-sm text-gray-60 dark:text-gray-10'}
136137
/>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*/
4+
5+
import * as React from 'react';
6+
import {IconClose} from '../../Icon/IconClose';
7+
export interface ClearButtonProps {
8+
onClear: () => void;
9+
}
10+
11+
export function ClearButton({onClear}: ClearButtonProps) {
12+
return (
13+
<button
14+
className="text-sm text-primary dark:text-primary-dark inline-flex items-center hover:text-link duration-100 ease-in transition mx-1"
15+
onClick={onClear}
16+
title="Clear all edits and reload sandbox"
17+
type="button">
18+
<IconClose className="inline mx-1 relative" />
19+
<span className="hidden md:block">Clear</span>
20+
</button>
21+
);
22+
}

src/components/MDX/Sandpack/NavigationBar.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import {
1717
useSandpackNavigation,
1818
} from '@codesandbox/sandpack-react/unstyled';
1919
import {OpenInCodeSandboxButton} from './OpenInCodeSandboxButton';
20-
import {ResetButton} from './ResetButton';
20+
import {ReloadButton} from './ReloadButton';
21+
import {ClearButton} from './ClearButton';
2122
import {DownloadButton} from './DownloadButton';
2223
import {IconChevron} from '../../Icon/IconChevron';
2324
import {Listbox} from '@headlessui/react';
@@ -95,21 +96,21 @@ export function NavigationBar({providedFiles}: {providedFiles: Array<string>}) {
9596
// Note: in a real useEvent, onContainerResize would be omitted.
9697
}, [isMultiFile, onContainerResize]);
9798

98-
const handleReset = () => {
99+
const handleClear = () => {
99100
/**
100101
* resetAllFiles must come first, otherwise
101102
* the previous content will appear for a second
102103
* when the iframe loads.
103104
*
104105
* Plus, it should only prompt if there's any file changes
105106
*/
106-
if (
107-
sandpack.editorState === 'dirty' &&
108-
confirm('Reset all your edits too?')
109-
) {
107+
if (sandpack.editorState === 'dirty' && confirm('Clear all your edits?')) {
110108
sandpack.resetAllFiles();
111109
}
110+
refresh();
111+
};
112112

113+
const handleReload = () => {
113114
refresh();
114115
};
115116

@@ -188,7 +189,8 @@ export function NavigationBar({providedFiles}: {providedFiles: Array<string>}) {
188189
className="px-3 flex items-center justify-end text-start"
189190
translate="yes">
190191
<DownloadButton providedFiles={providedFiles} />
191-
<ResetButton onReset={handleReset} />
192+
<ReloadButton onReload={handleReload} />
193+
<ClearButton onClear={handleClear} />
192194
<OpenInCodeSandboxButton />
193195
{activeFile.endsWith('.tsx') && (
194196
<OpenInTypeScriptPlaygroundButton

src/components/MDX/Sandpack/ResetButton.tsx renamed to src/components/MDX/Sandpack/ReloadButton.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44

55
import * as React from 'react';
66
import {IconRestart} from '../../Icon/IconRestart';
7-
export interface ResetButtonProps {
8-
onReset: () => void;
7+
export interface ReloadButtonProps {
8+
onReload: () => void;
99
}
1010

11-
export function ResetButton({onReset}: ResetButtonProps) {
11+
export function ReloadButton({onReload}: ReloadButtonProps) {
1212
return (
1313
<button
1414
className="text-sm text-primary dark:text-primary-dark inline-flex items-center hover:text-link duration-100 ease-in transition mx-1"
15-
onClick={onReset}
16-
title="Reset Sandbox"
15+
onClick={onReload}
16+
title="Keep your edits and reload sandbox"
1717
type="button">
18-
<IconRestart className="inline mx-1 relative" /> Reset
18+
<IconRestart className="inline mx-1 relative" />
19+
<span className="hidden md:block">Reload</span>
1920
</button>
2021
);
2122
}

src/content/blog/2025/04/21/react-compiler-rc.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,23 @@ During the RC period, we encourage all React users to try the compiler and provi
5757
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).
5858

5959
## Migrating from eslint-plugin-react-compiler to eslint-plugin-react-hooks {/*migrating-from-eslint-plugin-react-compiler-to-eslint-plugin-react-hooks*/}
60-
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!
60+
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!
6161

6262
To install:
6363

6464
npm
6565
<TerminalBlock>
66-
{`npm install --save-dev eslint-plugin-react-hooks@6.0.0-rc.1`}
66+
{`npm install --save-dev eslint-plugin-react-hooks@rc`}
6767
</TerminalBlock>
6868

6969
pnpm
7070
<TerminalBlock>
71-
{`pnpm add --save-dev eslint-plugin-react-hooks@6.0.0-rc.1`}
71+
{`pnpm add --save-dev eslint-plugin-react-hooks@rc`}
7272
</TerminalBlock>
7373

7474
yarn
7575
<TerminalBlock>
76-
{`yarn add --dev eslint-plugin-react-hooks@6.0.0-rc.1`}
76+
{`yarn add --dev eslint-plugin-react-hooks@rc`}
7777
</TerminalBlock>
7878

7979
```js

0 commit comments

Comments
 (0)