@@ -610,11 +610,13 @@ function ChatRoom({ roomId }) {
610610
611611### 你想读取一个值而不对其变化做出“反应”吗? {/*do-you-want-to-read-a-value-without-reacting-to-its-changes*/}
612612
613- <Wip >
613+ <Canary >
614614
615- 本节描述了一个在稳定版本的 React 中 **尚未发布的实验性** API。
615+ ** ` useEffectEvent ` API 当前仅在 React Canary 和 实验发行版中可用**。
616616
617- </Wip>
617+ [了解更多关于 React 版本发布的内容](/community/versioning-policy#all-release-channels)。
618+
619+ </Canary>
618620
619621假设你希望在用户收到新消息时播放声音,` isMuted` 为 ` true ` 除外:
620622
@@ -1261,8 +1263,8 @@ Effect 中是否有一行代码不应该是响应式的?如何将非响应式
12611263` ` ` json package .json hidden
12621264{
12631265 " dependencies" : {
1264- " react" : " experimental " ,
1265- " react-dom" : " experimental " ,
1266+ " react" : " canary " ,
1267+ " react-dom" : " canary " ,
12661268 " react-scripts" : " latest"
12671269 },
12681270 " scripts" : {
@@ -1276,7 +1278,7 @@ Effect 中是否有一行代码不应该是响应式的?如何将非响应式
12761278
12771279` ` ` js
12781280import { useState , useEffect , useRef } from ' react' ;
1279- import { experimental_useEffectEvent as useEffectEvent } from ' react' ;
1281+ import { useEffectEvent } from ' react' ;
12801282import { FadeInAnimation } from ' ./animation.js' ;
12811283
12821284function Welcome ({ duration }) {
@@ -1388,8 +1390,8 @@ Effect 需要读取 `duration` 的最新值,但你不希望它对 `duration`
13881390` ` ` json package .json hidden
13891391{
13901392 " dependencies" : {
1391- " react" : " experimental " ,
1392- " react-dom" : " experimental " ,
1393+ " react" : " canary " ,
1394+ " react-dom" : " canary " ,
13931395 " react-scripts" : " latest"
13941396 },
13951397 " scripts" : {
@@ -1404,7 +1406,7 @@ Effect 需要读取 `duration` 的最新值,但你不希望它对 `duration`
14041406` ` ` js
14051407import { useState , useEffect , useRef } from ' react' ;
14061408import { FadeInAnimation } from ' ./animation.js' ;
1407- import { experimental_useEffectEvent as useEffectEvent } from ' react' ;
1409+ import { useEffectEvent } from ' react' ;
14081410
14091411function Welcome ({ duration }) {
14101412 const ref = useRef (null );
@@ -1824,8 +1826,8 @@ label, button { display: block; margin-bottom: 5px; }
18241826` ` ` json package .json hidden
18251827{
18261828 " dependencies" : {
1827- " react" : " experimental " ,
1828- " react-dom" : " experimental " ,
1829+ " react" : " canary " ,
1830+ " react-dom" : " canary " ,
18291831 " react-scripts" : " latest" ,
18301832 " toastify-js" : " 1.12.0"
18311833 },
@@ -1906,7 +1908,7 @@ export default function App() {
19061908
19071909` ` ` js src/ ChatRoom .js active
19081910import { useState , useEffect } from ' react' ;
1909- import { experimental_useEffectEvent as useEffectEvent } from ' react' ;
1911+ import { useEffectEvent } from ' react' ;
19101912
19111913export default function ChatRoom ({ roomId, createConnection, onMessage }) {
19121914 useEffect (() => {
@@ -2119,8 +2121,8 @@ export default function ChatRoom({ roomId, isEncrypted, onMessage }) { // Reacti
21192121` ` ` json package .json hidden
21202122{
21212123 " dependencies" : {
2122- " react" : " experimental " ,
2123- " react-dom" : " experimental " ,
2124+ " react" : " canary " ,
2125+ " react-dom" : " canary " ,
21242126 " react-scripts" : " latest" ,
21252127 " toastify-js" : " 1.12.0"
21262128 },
@@ -2188,7 +2190,7 @@ export default function App() {
21882190
21892191` ` ` js src/ ChatRoom .js active
21902192import { useState , useEffect } from ' react' ;
2191- import { experimental_useEffectEvent as useEffectEvent } from ' react' ;
2193+ import { useEffectEvent } from ' react' ;
21922194import {
21932195 createEncryptedConnection ,
21942196 createUnencryptedConnection ,
0 commit comments