From 23ae76f10a7ecd8e2bfe4d10fcfdaf441f8d95b8 Mon Sep 17 00:00:00 2001 From: zqran Date: Sun, 4 Sep 2022 20:12:51 +0800 Subject: [PATCH] [Beta] add missing quotes (#4974) --- beta/src/pages/learn/lifecycle-of-reactive-effects.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beta/src/pages/learn/lifecycle-of-reactive-effects.md b/beta/src/pages/learn/lifecycle-of-reactive-effects.md index 87ef4bd30..4fb1c441b 100644 --- a/beta/src/pages/learn/lifecycle-of-reactive-effects.md +++ b/beta/src/pages/learn/lifecycle-of-reactive-effects.md @@ -158,7 +158,7 @@ function ChatRoom({ roomId /* "travel" */ }) { Thanks to this, you're now connected to the same room that the user chose in the UI. Disaster averted! -Every time after your component re-renders with a different `roomId`, your Effect will re-synchronize. For example, let's say the user changes `roomId` from `"travel"` to `"music"`. React will again **stop synchronizing** your Effect by calling its cleanup function (disconnecting you from the `"travel"` room). Then it will **start synchronizing** again by running its body with the new `roomId` prop (connecting you to the `"music` room). +Every time after your component re-renders with a different `roomId`, your Effect will re-synchronize. For example, let's say the user changes `roomId` from `"travel"` to `"music"`. React will again **stop synchronizing** your Effect by calling its cleanup function (disconnecting you from the `"travel"` room). Then it will **start synchronizing** again by running its body with the new `roomId` prop (connecting you to the `"music"` room). Finally, when the user goes to a different screen, `ChatRoom` unmounts. Now there is no need to stay connected at all. React will **stop synchronizing** your Effect one last time and disconnect you from the `"music"` chat room.