Skip to content

Commit 14ecdaf

Browse files
Merge pull request #39 from reactjs/sync-081d1008
Sync with react.dev @ 081d100
2 parents 02c8cd5 + d061706 commit 14ecdaf

11 files changed

+77
-70
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"check-all": "npm-run-all prettier lint:fix tsc"
2323
},
2424
"dependencies": {
25-
"@codesandbox/sandpack-react": "2.6.0",
25+
"@codesandbox/sandpack-react": "2.13.1",
2626
"@docsearch/css": "3.0.0-alpha.41",
2727
"@docsearch/react": "3.0.0-alpha.41",
2828
"@headlessui/react": "^1.7.0",

src/components/MDX/Sandpack/SandpackRoot.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function SandpackRoot(props: SandpackProps) {
8888
autorun,
8989
initMode: 'user-visible',
9090
initModeObserverOptions: {rootMargin: '1400px 0px'},
91-
bundlerURL: 'https://1e4ad8f7.sandpack-bundler-4bw.pages.dev',
91+
bundlerURL: 'https://786946de.sandpack-bundler-4bw.pages.dev',
9292
logLevel: SandpackLogLevel.None,
9393
}}>
9494
<CustomPreset providedFiles={Object.keys(files)} />

src/content/community/conferences.md

+16
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@ July 17-19, 2024. In-person in Portland, OR, USA
7070

7171
[Website](https://chainreactconf.com) - [Twitter](https://twitter.com/ChainReactConf)
7272

73+
### The Geek Conf 2024 {/*the-geek-conf-2024*/}
74+
July 25, 2024. In-person in Berlin, Germany + remote (hybrid event)
75+
76+
[Website](https://thegeekconf.com) - [Twitter](https://twitter.com/thegeekconf)
77+
78+
### React Universe Conf 2024 {/*react-universe-conf-2024*/}
79+
September 5-6, 2024. Wrocław, Poland.
80+
81+
[Website](https://www.reactuniverseconf.com/) - [Twitter](https://twitter.com/react_native_eu) - [LinkedIn](https://www.linkedin.com/events/reactuniverseconf7163919537074118657/)
82+
83+
### React Alicante 2024 {/*react-alicante-2024*/}
84+
September 19-21, 2024. Alicante, Spain.
85+
86+
[Website](https://reactalicante.es/) - [Twitter](https://twitter.com/ReactAlicante) - [YouTube](https://www.youtube.com/channel/UCaSdUaITU1Cz6PvC97A7e0w)
87+
88+
7389
### React India 2024 {/*react-india-2024*/}
7490
October 17 - 19, 2024. In-person in Goa, India (hybrid event) + Oct 15 2024 - remote day
7591

src/content/community/team.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Current members of the React team are listed in alphabetical order below.
2222
Andrey started his career as a designer and then gradually transitioned into web development. After joining the React Data team at Meta he worked on adding an incremental JavaScript compiler to Relay, and then later on, worked on removing the same compiler from Relay. Outside of work, Andrey likes to play music and engage in various sports.
2323
</TeamMember>
2424

25-
<TeamMember name="Dan Abramov" permalink="dan-abramov" photo="/images/team/gaearon.jpg" github="gaearon" twitter="dan_abramov" title="Engineer at Meta">
25+
<TeamMember name="Dan Abramov" permalink="dan-abramov" photo="/images/team/gaearon.jpg" github="gaearon" twitter="dan_abramov" title="Independent Engineer">
2626
Dan got into programming after he accidentally discovered Visual Basic inside Microsoft PowerPoint. He has found his true calling in turning [Sebastian](#sebastian-markbåge)'s tweets into long-form blog posts. Dan occasionally wins at Fortnite by hiding in a bush until the game ends.
2727
</TeamMember>
2828

src/content/learn/choosing-the-state-structure.md

-2
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,6 @@ button { margin-top: 10px; }
554554

555555
</Sandpack>
556556

557-
(Alternatively, you may hold the selected index in state.)
558-
559557
The state used to be duplicated like this:
560558

561559
* `items = [{ id: 0, title: 'pretzels'}, ...]`

src/content/reference/react-dom/hooks/useFormStatus.md

+28-29
Original file line numberDiff line numberDiff line change
@@ -182,47 +182,32 @@ import {useFormStatus} from 'react-dom';
182182
export default function UsernameForm() {
183183
const {pending, data} = useFormStatus();
184184

185-
const [showSubmitted, setShowSubmitted] = useState(false);
186-
const submittedUsername = useRef(null);
187-
const timeoutId = useRef(null);
188-
189-
useMemo(() => {
190-
if (pending) {
191-
submittedUsername.current = data?.get('username');
192-
if (timeoutId.current != null) {
193-
clearTimeout(timeoutId.current);
194-
}
195-
196-
timeoutId.current = setTimeout(() => {
197-
timeoutId.current = null;
198-
setShowSubmitted(false);
199-
}, 2000);
200-
setShowSubmitted(true);
201-
}
202-
}, [pending, data]);
203-
204185
return (
205-
<>
206-
<label>Request a Username: </label><br />
207-
<input type="text" name="username" />
186+
<div>
187+
<h3>Request a Username: </h3>
188+
<input type="text" name="username" disabled={pending}/>
208189
<button type="submit" disabled={pending}>
209-
{pending ? 'Submitting...' : 'Submit'}
190+
Submit
210191
</button>
211-
{showSubmitted ? (
212-
<p>Submitted request for username: {submittedUsername.current}</p>
213-
) : null}
214-
</>
192+
<br />
193+
<p>{data ? `Requesting ${data?.get("username")}...`: ''}</p>
194+
</div>
215195
);
216196
}
217197
```
218198
219199
```js src/App.js
220200
import UsernameForm from './UsernameForm';
221201
import { submitForm } from "./actions.js";
202+
import {useRef} from 'react';
222203
223204
export default function App() {
205+
const ref = useRef(null);
224206
return (
225-
<form action={submitForm}>
207+
<form ref={ref} action={async (formData) => {
208+
await submitForm(formData);
209+
ref.current.reset();
210+
}}>
226211
<UsernameForm />
227212
</form>
228213
);
@@ -231,8 +216,22 @@ export default function App() {
231216
232217
```js src/actions.js hidden
233218
export async function submitForm(query) {
234-
await new Promise((res) => setTimeout(res, 1000));
219+
await new Promise((res) => setTimeout(res, 2000));
220+
}
221+
```
222+
223+
```css
224+
p {
225+
height: 14px;
226+
padding: 0;
227+
margin: 2px 0 0 0 ;
228+
font-size: 14px
229+
}
230+
231+
button {
232+
margin-left: 2px;
235233
}
234+
236235
```
237236
238237
```json package.json hidden

src/content/reference/react-dom/server/renderToNodeStream.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This API will be removed in a future major version of React. Use [`renderToPipea
1313
`renderToNodeStream` renders a React tree to a [Node.js Readable Stream.](https://nodejs.org/api/stream.html#readable-streams)
1414

1515
```js
16-
const stream = renderToNodeStream(reactNode)
16+
const stream = renderToNodeStream(reactNode, options?)
1717
```
1818
1919
</Intro>
@@ -24,7 +24,7 @@ const stream = renderToNodeStream(reactNode)
2424
2525
## Reference {/*reference*/}
2626
27-
### `renderToNodeStream(reactNode)` {/*rendertonodestream*/}
27+
### `renderToNodeStream(reactNode, options?)` {/*rendertonodestream*/}
2828
2929
On the server, call `renderToNodeStream` to get a [Node.js Readable Stream](https://nodejs.org/api/stream.html#readable-streams) which you can pipe into the response.
3030

src/content/reference/react-dom/server/renderToStaticMarkup.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: renderToStaticMarkup
77
`renderToStaticMarkup` renders a non-interactive React tree to an HTML string.
88

99
```js
10-
const html = renderToStaticMarkup(reactNode)
10+
const html = renderToStaticMarkup(reactNode, options?)
1111
```
1212
1313
</Intro>
@@ -18,7 +18,7 @@ const html = renderToStaticMarkup(reactNode)
1818
1919
## Reference {/*reference*/}
2020
21-
### `renderToStaticMarkup(reactNode)` {/*rendertostaticmarkup*/}
21+
### `renderToStaticMarkup(reactNode, options?)` {/*rendertostaticmarkup*/}
2222
2323
On the server, call `renderToStaticMarkup` to render your app to HTML.
2424

src/content/reference/react-dom/server/renderToStaticNodeStream.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: renderToStaticNodeStream
77
`renderToStaticNodeStream` renders a non-interactive React tree to a [Node.js Readable Stream.](https://nodejs.org/api/stream.html#readable-streams)
88

99
```js
10-
const stream = renderToStaticNodeStream(reactNode)
10+
const stream = renderToStaticNodeStream(reactNode, options?)
1111
```
1212
1313
</Intro>
@@ -18,7 +18,7 @@ const stream = renderToStaticNodeStream(reactNode)
1818
1919
## Reference {/*reference*/}
2020
21-
### `renderToStaticNodeStream(reactNode)` {/*rendertostaticnodestream*/}
21+
### `renderToStaticNodeStream(reactNode, options?)` {/*rendertostaticnodestream*/}
2222
2323
On the server, call `renderToStaticNodeStream` to get a [Node.js Readable Stream](https://nodejs.org/api/stream.html#readable-streams).
2424

src/content/reference/react-dom/server/renderToString.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ title: renderToString
1313
`renderToString` renders a React tree to an HTML string.
1414

1515
```js
16-
const html = renderToString(reactNode)
16+
const html = renderToString(reactNode, options?)
1717
```
1818
1919
</Intro>
@@ -24,7 +24,7 @@ const html = renderToString(reactNode)
2424
2525
## Reference {/*reference*/}
2626
27-
### `renderToString(reactNode)` {/*rendertostring*/}
27+
### `renderToString(reactNode, options?)` {/*rendertostring*/}
2828
2929
On the server, call `renderToString` to render your app to HTML.
3030

yarn.lock

+22-28
Original file line numberDiff line numberDiff line change
@@ -611,29 +611,29 @@
611611
style-mod "^4.0.0"
612612
w3c-keyname "^2.2.4"
613613

614-
"@codesandbox/[email protected].4":
615-
version "0.1.4"
616-
resolved "https://registry.yarnpkg.com/@codesandbox/nodebox/-/nodebox-0.1.4.tgz#1c9ed4caf6cda764500aec3d46b245e2e9b88ccc"
617-
integrity sha512-+MR7JibjGjTRDmyQbL8Mliej6wakQP7q99+wGL/nOzd0Q3s+YWGQfv0QpYKbdMClKUTFJGvwzwOeqHVTkpWNCQ==
614+
"@codesandbox/[email protected].8":
615+
version "0.1.8"
616+
resolved "https://registry.yarnpkg.com/@codesandbox/nodebox/-/nodebox-0.1.8.tgz#2dc701005cedefac386f17a69a4c9a4f38c2325d"
617+
integrity sha512-2VRS6JDSk+M+pg56GA6CryyUSGPjBEe8Pnae0QL3jJF1mJZJVMDKr93gJRtBbLkfZN6LD/DwMtf+2L0bpWrjqg==
618618
dependencies:
619-
outvariant "^1.3.0"
619+
outvariant "^1.4.0"
620620
strict-event-emitter "^0.4.3"
621621

622-
"@codesandbox/sandpack-client@^2.6.0":
623-
version "2.6.0"
624-
resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-client/-/sandpack-client-2.6.0.tgz#a266ac49843a0c3263ac065daaba473cb9565193"
625-
integrity sha512-JFCe+MU+5E+nXazrNK1uS/zLV5l4UNkYQx7AjF9sJ5ZmUlshz1HRDiK/Tdp6W+3ahcSERF3dcYPCf46LJF8Yvw==
622+
"@codesandbox/sandpack-client@^2.13.0":
623+
version "2.13.0"
624+
resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-client/-/sandpack-client-2.13.0.tgz#c4e12628a3aceb4a2c99c501bea691b4276eab27"
625+
integrity sha512-1rOLj9wkbBd3RV6/zRq+IV52egy22RQMKDTtdR+lQzy87uj0tlbYjAwtUZSjkioHlj6U8Y82uWLf71nvFIxE0g==
626626
dependencies:
627-
"@codesandbox/nodebox" "0.1.4"
627+
"@codesandbox/nodebox" "0.1.8"
628628
buffer "^6.0.3"
629629
dequal "^2.0.2"
630-
outvariant "1.3.0"
630+
outvariant "1.4.0"
631631
static-browser-server "1.0.3"
632632

633-
"@codesandbox/sandpack-react@2.6.0":
634-
version "2.6.0"
635-
resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-react/-/sandpack-react-2.6.0.tgz#2c2d98b50c9db462a32831071de7e5e710d000c2"
636-
integrity sha512-zSeJXzaVt96aIFfkyr+bMKBjV2k3hVcX+j1+aBRIOCpHhTrbszPesUmcE3yNTzGqqQfX/JnIJNRmeqFKmSLjTQ==
633+
"@codesandbox/sandpack-react@2.13.1":
634+
version "2.13.1"
635+
resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-react/-/sandpack-react-2.13.1.tgz#ba69a227d0c5157bb48685a02fefc0baa83bdc09"
636+
integrity sha512-R8oGO4QHHWTyA7r6NWHtBakizgX+rl/Rc6cbQunXGNm4vV/lqqU4NS+MVp2rXA+c8DifOLi1wA2wUZUN//Z9bw==
637637
dependencies:
638638
"@codemirror/autocomplete" "^6.4.0"
639639
"@codemirror/commands" "^6.1.3"
@@ -643,13 +643,12 @@
643643
"@codemirror/language" "^6.3.2"
644644
"@codemirror/state" "^6.2.0"
645645
"@codemirror/view" "^6.7.1"
646-
"@codesandbox/sandpack-client" "^2.6.0"
646+
"@codesandbox/sandpack-client" "^2.13.0"
647647
"@lezer/highlight" "^1.1.3"
648648
"@react-hook/intersection-observer" "^3.1.1"
649649
"@stitches/core" "^1.2.6"
650650
anser "^2.1.1"
651651
clean-set "^1.1.2"
652-
codesandbox-import-util-types "^2.2.3"
653652
dequal "^2.0.2"
654653
escape-carriage "^1.3.1"
655654
lz-string "^1.4.4"
@@ -1769,11 +1768,6 @@ [email protected]:
17691768
resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1"
17701769
integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==
17711770

1772-
codesandbox-import-util-types@^2.2.3:
1773-
version "2.2.3"
1774-
resolved "https://registry.yarnpkg.com/codesandbox-import-util-types/-/codesandbox-import-util-types-2.2.3.tgz#b354b2f732ad130e119ebd9ead3bda3be5981a54"
1775-
integrity sha512-Qj00p60oNExthP2oR3vvXmUGjukij+rxJGuiaKM6tyUmSyimdZsqHI/TUvFFClAffk9s7hxGnQgWQ8KCce27qQ==
1776-
17771771
collapse-white-space@^1.0.2:
17781772
version "1.0.6"
17791773
resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.6.tgz#e63629c0016665792060dbbeb79c42239d2c5287"
@@ -4635,16 +4629,16 @@ os-tmpdir@~1.0.2:
46354629
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
46364630
integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=
46374631

4638-
4639-
version "1.3.0"
4640-
resolved "https://registry.yarnpkg.com/outvariant/-/outvariant-1.3.0.tgz#c39723b1d2cba729c930b74bf962317a81b9b1c9"
4641-
integrity sha512-yeWM9k6UPfG/nzxdaPlJkB2p08hCg4xP6Lx99F+vP8YF7xyZVfTmJjrrNalkmzudD4WFvNLVudQikqUmF8zhVQ==
4642-
4643-
outvariant@^1.3.0:
4632+
[email protected], outvariant@^1.3.0:
46444633
version "1.4.0"
46454634
resolved "https://registry.yarnpkg.com/outvariant/-/outvariant-1.4.0.tgz#e742e4bda77692da3eca698ef5bfac62d9fba06e"
46464635
integrity sha512-AlWY719RF02ujitly7Kk/0QlV+pXGFDHrHf9O2OKqyqgBieaPOIeuSkL8sRK6j2WK+/ZAURq2kZsY0d8JapUiw==
46474636

4637+
outvariant@^1.4.0:
4638+
version "1.4.2"
4639+
resolved "https://registry.yarnpkg.com/outvariant/-/outvariant-1.4.2.tgz#f54f19240eeb7f15b28263d5147405752d8e2066"
4640+
integrity sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ==
4641+
46484642
p-limit@^1.1.0:
46494643
version "1.3.0"
46504644
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"

0 commit comments

Comments
 (0)