News for hackers. Stuff that matters.
Re:Thoughts on Svelte by lozenge on Monday March 27, 2023 @02:43PM (#35330589)
That's the case for useSyncExternalStore.
Re:Thoughts on Svelte by talkingtab on Tuesday March 28, 2023 @08:19PM (#35350155)
Thanks! Just what I needed.

On a side note, is there a place that talks about this issue in React and explains why this is needed? There is a hint in the doc. It says "... that hold state outside of React".

Using web sockets, events come in and some (and only some )affect components. When a socket is connected there is an explicit state that changes, but how that gets into React-Land is difficult. The same issue exists with WebRTC. What I don't really get is why useRef, useState and useEffect are so difficult to get right.