Fix wrong documentation for effect events (#7800)

* Fix wrong documentation for effect events

* Update src/content/learn/separating-events-from-effects.md

---------

Co-authored-by: Ricky <rickhanlonii@gmail.com>
This commit is contained in:
Gourav Bhardwaj
2025-05-16 09:09:15 -07:00
committed by GitHub
parent a73055f821
commit e2d9fd7f7d

View File

@@ -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, 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: