---
title: "Comment by Ahmet Özel on \"Decoupling WebSockets from React Server Components\" | Hashnode"
description: "There is a lifecycle issue in the sample that would work against the snapshot-plus-delta design: getKey is an inline function in LiveActivityContainer, while th"
url: "https://hashnode.com/posts/decoupling-websockets-from-react-server-components/6aca6434edc78ca8dd27c97e/comment/6acb5a875c53a49145b03eae"
---

[Discussion](https://hashnode.com/posts/decoupling-websockets-from-react-server-components/6aca6434edc78ca8dd27c97e)

Comment [Decoupling WebSockets from React Server Components](https://hashnode.com/posts/decoupling-websockets-from-react-server-components/6aca6434edc78ca8dd27c97e)

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Oct 11](https://hashnode.com/posts/decoupling-websockets-from-react-server-components/6aca6434edc78ca8dd27c97e/comment/6acb5a875c53a49145b03eae)

There is a lifecycle issue in the sample that would work against the snapshot-plus-delta design: getKey is an inline function in LiveActivityContainer, while the hook includes getKey in its effect dependencies. Each setData update rerenders the component, creates a new function and can close and reopen the socket.

I would give that key extractor a stable identity and add a test asserting that several incoming updates keep one connection open. Otherwise a healthy event stream can produce its own reconnect churn, even after removing every router.refresh call. That is separate from deduplicating the initial snapshot.
