Skip to content

Commit 275e6c4

Browse files
authored
Merge branch 'main' into sync-6326e7b1
2 parents fbc8715 + f700293 commit 275e6c4

29 files changed

+124
-127
lines changed

.github/workflows/analyze.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- main # change this if your default branch is named differently
88
workflow_dispatch:
99

10+
permissions: {}
11+
1012
jobs:
1113
analyze:
1214
runs-on: ubuntu-latest
@@ -23,7 +25,7 @@ jobs:
2325
- name: Restore cached node_modules
2426
uses: actions/cache@v4
2527
with:
26-
path: "**/node_modules"
28+
path: '**/node_modules'
2729
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
2830

2931
- name: Install deps
@@ -55,7 +57,7 @@ jobs:
5557
name: bundle_analysis.json
5658

5759
- name: Download base branch bundle stats
58-
uses: dawidd6/action-download-artifact@v2
60+
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
5961
if: success() && github.event.number
6062
with:
6163
workflow: analyze.yml

.github/workflows/analyze_comment.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ name: Analyze Bundle (Comment)
22

33
on:
44
workflow_run:
5-
workflows: ["Analyze Bundle"]
5+
workflows: ['Analyze Bundle']
66
types:
77
- completed
88

9+
permissions: {}
10+
911
jobs:
1012
comment:
1113
runs-on: ubuntu-latest
@@ -14,15 +16,15 @@ jobs:
1416
github.event.workflow_run.conclusion == 'success' }}
1517
steps:
1618
- name: Download base branch bundle stats
17-
uses: dawidd6/action-download-artifact@v2
19+
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
1820
with:
1921
workflow: analyze.yml
2022
run_id: ${{ github.event.workflow_run.id }}
2123
name: analysis_comment.txt
2224
path: analysis_comment.txt
2325

2426
- name: Download PR number
25-
uses: dawidd6/action-download-artifact@v2
27+
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
2628
with:
2729
workflow: analyze.yml
2830
run_id: ${{ github.event.workflow_run.id }}
@@ -48,7 +50,7 @@ jobs:
4850
echo "pr-number=$pr_number" >> $GITHUB_OUTPUT
4951
5052
- name: Comment
51-
uses: marocchino/sticky-pull-request-comment@v2
53+
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728
5254
with:
5355
header: next-bundle-analysis
5456
number: ${{ steps.get-comment-body.outputs.pr-number }}

.github/workflows/discord_notify.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ on:
77
jobs:
88
check_maintainer:
99
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
10+
permissions:
11+
# Used by check_maintainer
12+
contents: read
1013
with:
1114
actor: ${{ github.event.pull_request.user.login }}
12-
is_remote: true
1315

1416
notify:
1517
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}

.github/workflows/label_core_team_prs.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: Label Core Team PRs
22

33
on:
4-
pull_request_target:
4+
pull_request:
5+
6+
permissions: {}
7+
8+
permissions: {}
59

610
env:
711
TZ: /usr/share/zoneinfo/America/Los_Angeles
@@ -11,14 +15,21 @@ env:
1115
jobs:
1216
check_maintainer:
1317
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
18+
permissions:
19+
# Used by check_maintainer
20+
contents: read
1421
with:
1522
actor: ${{ github.event.pull_request.user.login }}
16-
is_remote: true
1723

1824
label:
1925
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}
2026
runs-on: ubuntu-latest
2127
needs: check_maintainer
28+
permissions:
29+
# Used to add labels on issues
30+
issues: write
31+
# Used to add labels on PRs
32+
pull-requests: write
2233
steps:
2334
- name: Label PR as React Core Team
2435
uses: actions/github-script@v7

.github/workflows/site_lint.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
pull_request:
88
types: [opened, synchronize, reopened]
99

10+
permissions: {}
11+
1012
jobs:
1113
lint:
1214
runs-on: ubuntu-latest
@@ -25,7 +27,7 @@ jobs:
2527
- name: Restore cached node_modules
2628
uses: actions/cache@v4
2729
with:
28-
path: "**/node_modules"
30+
path: '**/node_modules'
2931
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
3032

3133
- name: Install deps

postcss.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ module.exports = {
1717
},
1818
},
1919
},
20-
}
20+
};

public/js/jsfiddle-integration-babel.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
// Do not delete or move this file.
66
// Many fiddles reference it so we have to keep it here.
7-
(function() {
7+
(function () {
88
var tag = document.querySelector(
99
'script[type="application/javascript;version=1.7"]'
1010
);
1111
if (!tag || tag.textContent.indexOf('window.onload=function(){') !== -1) {
12-
alert('Bad JSFiddle configuration, please fork the original React JSFiddle');
12+
alert(
13+
'Bad JSFiddle configuration, please fork the original React JSFiddle'
14+
);
1315
}
1416
tag.setAttribute('type', 'text/babel');
1517
tag.textContent = tag.textContent.replace(/^\/\/<!\[CDATA\[/, '');

public/js/jsfiddle-integration.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
// Do not delete or move this file.
66
// Many fiddles reference it so we have to keep it here.
7-
(function() {
7+
(function () {
88
var tag = document.querySelector(
99
'script[type="application/javascript;version=1.7"]'
1010
);
1111
if (!tag || tag.textContent.indexOf('window.onload=function(){') !== -1) {
12-
alert('Bad JSFiddle configuration, please fork the original React JSFiddle');
12+
alert(
13+
'Bad JSFiddle configuration, please fork the original React JSFiddle'
14+
);
1315
}
1416
tag.setAttribute('type', 'text/jsx;harmony=true');
1517
tag.textContent = tag.textContent.replace(/^\/\/<!\[CDATA\[/, '');

scripts/headingIDHelpers/walk.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ const fs = require('fs');
22

33
module.exports = function walk(dir) {
44
let results = [];
5-
/**
5+
/**
66
* If the param is a directory we can return the file
77
*/
8-
if(dir.includes('md')){
8+
if (dir.includes('md')) {
99
return [dir];
1010
}
1111
const list = fs.readdirSync(dir);

scripts/headingIdLinter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
const validateHeaderIds = require('./headingIDHelpers/validateHeadingIDs');
22
const generateHeadingIds = require('./headingIDHelpers/generateHeadingIDs');
33

4-
/**
4+
/**
55
* yarn lint-heading-ids --> Checks all files and causes an error if heading ID is missing
66
* yarn lint-heading-ids --fix --> Fixes all markdown file's heading IDs
77
* yarn lint-heading-ids path/to/markdown.md --> Checks that particular file for missing heading ID (path can denote a directory or particular file)
88
* yarn lint-heading-ids --fix path/to/markdown.md --> Fixes that particular file's markdown IDs (path can denote a directory or particular file)
9-
*/
9+
*/
1010

1111
const markdownPaths = process.argv.slice(2);
1212
if (markdownPaths.includes('--fix')) {

src/components/Layout/Page.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {useRouter} from 'next/router';
88
import {SidebarNav} from './SidebarNav';
99
import {Footer} from './Footer';
1010
import {Toc} from './Toc';
11-
// import SocialBanner from '../SocialBanner';
11+
import SocialBanner from '../SocialBanner';
1212
import {DocsPageFooter} from 'components/DocsFooter';
1313
import {Seo} from 'components/Seo';
1414
import PageHeading from 'components/PageHeading';
@@ -137,7 +137,7 @@ export function Page({
137137
/>
138138
</Head>
139139
)}
140-
{/*<SocialBanner />*/}
140+
<SocialBanner />
141141
<TopNav
142142
section={section}
143143
routeTree={routeTree}

src/components/MDX/ErrorDecoder.tsx

+17-12
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function parseQueryString(search: string): Array<string | undefined> {
6969
}
7070

7171
export default function ErrorDecoder() {
72-
const {errorMessage} = useErrorDecoderParams();
72+
const {errorMessage, errorCode} = useErrorDecoderParams();
7373
/** error messages that contain %s require reading location.search */
7474
const hasParams = errorMessage?.includes('%s');
7575
const [message, setMessage] = useState<React.ReactNode | null>(() =>
@@ -82,23 +82,28 @@ export default function ErrorDecoder() {
8282
if (errorMessage == null || !hasParams) {
8383
return;
8484
}
85+
const args = parseQueryString(window.location.search);
86+
let message = errorMessage;
87+
if (errorCode === '418') {
88+
// Hydration errors have a %s for the diff, but we don't add that to the args for security reasons.
89+
message = message.replace(/%s$/, '');
8590

86-
setMessage(
87-
urlify(
88-
replaceArgs(
89-
errorMessage,
90-
parseQueryString(window.location.search),
91-
'[missing argument]'
92-
)
93-
)
94-
);
91+
// Before React 19.1, the error message didn't have an arg, and was always HTML.
92+
if (args.length === 0) {
93+
args.push('HTML');
94+
} else if (args.length === 1 && args[0] === '') {
95+
args[0] = 'HTML';
96+
}
97+
}
98+
99+
setMessage(urlify(replaceArgs(message, args, '[missing argument]')));
95100
setIsReady(true);
96-
}, [hasParams, errorMessage]);
101+
}, [errorCode, hasParams, errorMessage]);
97102

98103
return (
99104
<code
100105
className={cn(
101-
'block bg-red-100 text-red-600 py-4 px-6 mt-5 rounded-lg',
106+
'whitespace-pre-line block bg-red-100 text-red-600 py-4 px-6 mt-5 rounded-lg',
102107
isReady ? 'opacity-100' : 'opacity-0'
103108
)}>
104109
<b>{message}</b>

src/components/MDX/Sandpack/template.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ root.render(
2828
eject: 'react-scripts eject',
2929
},
3030
dependencies: {
31-
react: '19.0.0-rc-3edc000d-20240926',
32-
'react-dom': '19.0.0-rc-3edc000d-20240926',
31+
react: '^19.1.0',
32+
'react-dom': '^19.1.0',
3333
'react-scripts': '^5.0.0',
3434
},
3535
},

src/components/SocialBanner.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {useRef, useEffect} from 'react';
77
import cn from 'classnames';
88
import {ExternalLink} from './ExternalLink';
99

10-
const bannerText = 'Stream React Conf on May 15-16.';
10+
const bannerText = 'Join us for React Conf on Oct 7-8.';
1111
const bannerLink = 'https://conf.react.dev/';
1212
const bannerLinkText = 'Learn more.';
1313

src/content/community/conferences.md

+15-10
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c
1010

1111
## Upcoming Conferences {/*upcoming-conferences*/}
1212

13-
### React Paris 2025 {/*react-paris-2025*/}
14-
March 20 - 21, 2025. In-person in Paris, France (hybrid event)
15-
16-
[Website](https://react.paris/) - [Twitter](https://x.com/BeJS_)
17-
18-
### React Native Connection 2025 {/*react-native-connection-2025*/}
19-
April 3 (Reanimated Training) + April 4 (Conference), 2025. Paris, France.
20-
21-
[Website](https://reactnativeconnection.io/) - [X](https://x.com/reactnativeconn) - [Bluesky](https://bsky.app/profile/reactnativeconnect.bsky.social)
22-
2313
### CityJS London 2025 {/*cityjs-london*/}
2414
April 23 - 25, 2025. In-person in London, UK
2515

@@ -50,6 +40,11 @@ September 2-4, 2025. Wrocław, Poland.
5040

5141
[Website](https://www.reactuniverseconf.com/) - [Twitter](https://twitter.com/react_native_eu) - [LinkedIn](https://www.linkedin.com/events/reactuniverseconf7163919537074118657/)
5242

43+
### React Conf 2025 {/*react-conf-2025*/}
44+
October 7-8, 2025. Henderson, Nevada, USA and free livestream
45+
46+
[Website](https://conf.react.dev/) - [Twitter](https://x.com/reactjs) - [Bluesky](https://bsky.app/profile/react.dev)
47+
5348
### React India 2025 {/*react-india-2025*/}
5449
October 31 - November 01, 2025. In-person in Goa, India (hybrid event) + Oct 15 2025 - remote day
5550

@@ -58,6 +53,16 @@ October 31 - November 01, 2025. In-person in Goa, India (hybrid event) + Oct 15
5853

5954
## Past Conferences {/*past-conferences*/}
6055

56+
### React Paris 2025 {/*react-paris-2025*/}
57+
March 20 - 21, 2025. In-person in Paris, France (hybrid event)
58+
59+
[Website](https://react.paris/) - [Twitter](https://x.com/BeJS_)
60+
61+
### React Native Connection 2025 {/*react-native-connection-2025*/}
62+
April 3 (Reanimated Training) + April 4 (Conference), 2025. Paris, France.
63+
64+
[Website](https://reactnativeconnection.io/) - [X](https://x.com/reactnativeconn) - [Bluesky](https://bsky.app/profile/reactnativeconnect.bsky.social)
65+
6166
### React Day Berlin 2024 {/*react-day-berlin-2024*/}
6267
December 13 & 16, 2024. In-person in Berlin, Germany + remote (hybrid event)
6368

src/content/community/meetups.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
4747
## Colombia {/*colombia*/}
4848
* [Medellin](https://www.meetup.com/React-Medellin/)
4949

50+
## Czechia {/*czechia*/}
51+
* [Prague](https://guild.host/react-prague/)
52+
5053
## Denmark {/*denmark*/}
5154
* [Aalborg](https://www.meetup.com/Aalborg-React-React-Native-Meetup/)
5255
* [Aarhus](https://www.meetup.com/Aarhus-ReactJS-Meetup/)
@@ -78,7 +81,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
7881
* [Thessaloniki](https://www.meetup.com/Thessaloniki-ReactJS-Meetup/)
7982

8083
## India {/*india*/}
81-
* [Ahmedabad](https://www.meetup.com/react-ahmedabad/)
84+
* [Ahmedabad](https://reactahmedabad.dev/)
8285
* [Bangalore (React)](https://www.meetup.com/ReactJS-Bangalore/)
8386
* [Bangalore (React Native)](https://www.meetup.com/React-Native-Bangalore-Meetup)
8487
* [Chennai](https://www.linkedin.com/company/chennaireact)
@@ -166,6 +169,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
166169
* [Cleveland, OH - ReactJS](https://www.meetup.com/Cleveland-React/)
167170
* [Columbus, OH - ReactJS](https://www.meetup.com/ReactJS-Columbus-meetup/)
168171
* [Dallas, TX - ReactJS](https://www.meetup.com/ReactDallas/)
172+
* [Denver, CO - React Denver](https://reactdenver.com/)
169173
* [Detroit, MI - Detroit React User Group](https://www.meetup.com/Detroit-React-User-Group/)
170174
* [Indianapolis, IN - React.Indy](https://www.meetup.com/React-Indy)
171175
* [Irvine, CA - ReactJS](https://www.meetup.com/ReactJS-OC/)

src/content/learn/creating-a-react-app.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ If you want to build your own solutions, see our guide to [build a React app fro
110110

111111
-----
112112

113-
_If you’re a framework author interested in being included on this page, [please let us know](https://github.com/reactjs/react.dev/issues/new?assignees=&labels=type%3A+framework&projects=&template=3-framework.yml&title=%5BFramework%5D%3A+)._
113+
_If you’re a framework author interested in being included on this page, [please let us know](https://github.com/reactjs/react.dev/issues/new?assignees=&labels=type%3A+framework&projects=&template=3-framework.yml&title=%5BFramework%5D%3A+)._

src/content/learn/reusing-logic-with-custom-hooks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ export function useOnlineStatus() {
13331333
13341334
In the above example, `useOnlineStatus` is implemented with a pair of [`useState`](/reference/react/useState) and [`useEffect`.](/reference/react/useEffect) However, this isn't the best possible solution. There is a number of edge cases it doesn't consider. For example, it assumes that when the component mounts, `isOnline` is already `true`, but this may be wrong if the network already went offline. You can use the browser [`navigator.onLine`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine) API to check for that, but using it directly would not work on the server for generating the initial HTML. In short, this code could be improved.
13351335
1336-
Luckily, React 18 includes a dedicated API called [`useSyncExternalStore`](/reference/react/useSyncExternalStore) which takes care of all of these problems for you. Here is how your `useOnlineStatus` Hook, rewritten to take advantage of this new API:
1336+
React includes a dedicated API called [`useSyncExternalStore`](/reference/react/useSyncExternalStore) which takes care of all of these problems for you. Here is your `useOnlineStatus` Hook, rewritten to take advantage of this new API:
13371337
13381338
<Sandpack>
13391339

src/content/learn/tutorial-tic-tac-toe.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2247,7 +2247,7 @@ body {
22472247
22482248
</Sandpack>
22492249
2250-
As you iterate through `history` array inside the function you passed to `map`, the `squares` argument goes through each element of `history`, and the `move` argument goes through each array index: `0`, `1`, `2`, …. (In most cases, you'd need the actual array elements, but to render a list of moves you will only need indexes.)
2250+
As you iterate through the `history` array inside the function you passed to `map`, the `squares` argument goes through each element of `history`, and the `move` argument goes through each array index: `0`, `1`, `2`, …. (In most cases, you'd need the actual array elements, but to render a list of moves you will only need indexes.)
22512251
22522252
For each move in the tic-tac-toe game's history, you create a list item `<li>` which contains a button `<button>`. The button has an `onClick` handler which calls a function called `jumpTo` (that you haven't implemented yet).
22532253

0 commit comments

Comments
 (0)