From f275c9d3c2f252d7ebecdcb0d4eaead72bca1df3 Mon Sep 17 00:00:00 2001 From: Xleine Date: Sat, 17 May 2025 10:46:53 +0800 Subject: [PATCH 1/4] fix: remove useless content (#6615) --- src/content/reference/react-dom/preinit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/reference/react-dom/preinit.md b/src/content/reference/react-dom/preinit.md index 0ecd1972d7..117fccac86 100644 --- a/src/content/reference/react-dom/preinit.md +++ b/src/content/reference/react-dom/preinit.md @@ -48,7 +48,7 @@ The `preinit` function provides the browser with a hint that it should start dow * `options`: an object. It contains the following properties: * `as`: a required string. The type of resource. Its possible values are `script` and `style`. * `precedence`: a string. Required with stylesheets. Says where to insert the stylesheet relative to others. Stylesheets with higher precedence can override those with lower precedence. The possible values are `reset`, `low`, `medium`, `high`. - * `crossOrigin`: a string. The [CORS policy](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) to use. Its possible values are `anonymous` and `use-credentials`. It is required when `as` is set to `"fetch"`. + * `crossOrigin`: a string. The [CORS policy](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) to use. Its possible values are `anonymous` and `use-credentials`. * `integrity`: a string. A cryptographic hash of the resource, to [verify its authenticity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity). * `nonce`: a string. A cryptographic [nonce to allow the resource](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce) when using a strict Content Security Policy. * `fetchPriority`: a string. Suggests a relative priority for fetching the resource. The possible values are `auto` (the default), `high`, and `low`. From 0b68054c50144e4b94426a9432eb65268fb824d8 Mon Sep 17 00:00:00 2001 From: Ayman Alhourani <139303034+aalhoura@users.noreply.github.com> Date: Sat, 17 May 2025 14:07:08 -0400 Subject: [PATCH 2/4] fix: wrong verb tense in doc (#7818) --- src/content/learn/reusing-logic-with-custom-hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/learn/reusing-logic-with-custom-hooks.md b/src/content/learn/reusing-logic-with-custom-hooks.md index e2f8770d45..b6562e2df5 100644 --- a/src/content/learn/reusing-logic-with-custom-hooks.md +++ b/src/content/learn/reusing-logic-with-custom-hooks.md @@ -820,7 +820,7 @@ export default function ChatRoom({ roomId }) { // ... ``` -and pass it as an input to another Hook: +and passing it as an input to another Hook: ```js {6} export default function ChatRoom({ roomId }) { From 65d297e93b36be5370e58ab7828d022c741ecbe2 Mon Sep 17 00:00:00 2001 From: Ayman Alhourani <139303034+aalhoura@users.noreply.github.com> Date: Sat, 17 May 2025 14:07:49 -0400 Subject: [PATCH 3/4] fix: typo in challenge solution (#7816) --- src/content/learn/removing-effect-dependencies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/learn/removing-effect-dependencies.md b/src/content/learn/removing-effect-dependencies.md index 9a871c6c3f..9a848862a3 100644 --- a/src/content/learn/removing-effect-dependencies.md +++ b/src/content/learn/removing-effect-dependencies.md @@ -1241,7 +1241,7 @@ export default function Timer() { -Instead of reading `count` inside the Effect, you pass a `c => c + 1` instruction ("increment this number!") to React. React will apply it on the next render. And since you don't need to read the value of `count` inside your Effect anymore, so you can keep your Effect's dependencies empty (`[]`). This prevents your Effect from re-creating the interval on every tick. +Instead of reading `count` inside the Effect, you pass a `c => c + 1` instruction ("increment this number!") to React. React will apply it on the next render. And since you don't need to read the value of `count` inside your Effect anymore, you can keep your Effect's dependencies empty (`[]`). This prevents your Effect from re-creating the interval on every tick. From f15830d5a1eec60d474a57e700f3acba5eb65659 Mon Sep 17 00:00:00 2001 From: Ricky Date: Tue, 20 May 2025 15:39:48 -0400 Subject: [PATCH 4/4] Use experiemental in all uEE doc sandboxes (#7820) --- .../learn/separating-events-from-effects.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/content/learn/separating-events-from-effects.md b/src/content/learn/separating-events-from-effects.md index 335867b4df..03223183b1 100644 --- a/src/content/learn/separating-events-from-effects.md +++ b/src/content/learn/separating-events-from-effects.md @@ -973,6 +973,23 @@ To fix this code, it's enough to follow the rules. +```json package.json hidden +{ + "dependencies": { + "react": "experimental", + "react-dom": "experimental", + "react-scripts": "latest" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test --env=jsdom", + "eject": "react-scripts eject" + } +} +``` + + ```js import { useState, useEffect } from 'react'; @@ -1026,6 +1043,22 @@ If you remove the suppression comment, React will tell you that this Effect's co +```json package.json hidden +{ + "dependencies": { + "react": "experimental", + "react-dom": "experimental", + "react-scripts": "latest" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test --env=jsdom", + "eject": "react-scripts eject" + } +} +``` + ```js import { useState, useEffect } from 'react';