From 132ef6c5457c223b5bdee93747c480bd3b92e6d1 Mon Sep 17 00:00:00 2001 From: Gourav Bhardwaj Date: Tue, 6 May 2025 13:06:14 -0700 Subject: [PATCH 1/2] Fix wrong documentation for effect events --- src/content/learn/separating-events-from-effects.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/learn/separating-events-from-effects.md b/src/content/learn/separating-events-from-effects.md index 21276c28710..5560d28ef67 100644 --- a/src/content/learn/separating-events-from-effects.md +++ b/src/content/learn/separating-events-from-effects.md @@ -439,7 +439,7 @@ function ChatRoom({ roomId, theme }) { // ... ``` -This solves the problem. Note that you had to *remove* `onConnected` from the list of your Effect's dependencies. **Effect Events are not reactive and must be omitted from dependencies.** +This solves the problem. Note that you had to *remove* `theme` from the list of your Effect's dependencies, and you also don't need to *add* `onConnected` to it . **Effect Events are not reactive and must be omitted from dependencies.** Verify that the new behavior works as you would expect: From bb90c0ce7844584b1d48fff096ce7f26c479c14a Mon Sep 17 00:00:00 2001 From: Ricky Date: Fri, 16 May 2025 11:57:26 -0400 Subject: [PATCH 2/2] Update src/content/learn/separating-events-from-effects.md --- src/content/learn/separating-events-from-effects.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/learn/separating-events-from-effects.md b/src/content/learn/separating-events-from-effects.md index 5560d28ef67..335867b4df9 100644 --- a/src/content/learn/separating-events-from-effects.md +++ b/src/content/learn/separating-events-from-effects.md @@ -439,7 +439,7 @@ function ChatRoom({ roomId, theme }) { // ... ``` -This solves the problem. Note that you had to *remove* `theme` from the list of your Effect's dependencies, and you also don't need to *add* `onConnected` to it . **Effect Events are not reactive and must be omitted from dependencies.** +This solves the problem. Note that you had to *remove* `theme` from the list of your Effect's dependencies, because it's no longer used in the Effect. You also don't need to *add* `onConnected` to it, because **Effect Events are not reactive and must be omitted from dependencies.** Verify that the new behavior works as you would expect: