DEV Community

Discussion on: I built a 20 kB React hook that doesn't care which AI you use — here's how streaming actually works

Collapse
 
syedahmershah profile image
Syed Ahmer Shah

Decoupling the stream from the provider is the right move. Using Zustand to handle those high-frequency token updates is a smart fix for re-renders.

Collapse
 
trimooo profile image
devleo

Appreciate that. The goal was to keep the React layer as stable as possible while the stream updates independently — Zustand ended up fitting that model really well.