Marked as helpful by the asker
state.push mutates the array in place; React compares references and sees no change. Create a new array:
setOrders((prev) => [...prev, payload.new]);Also enable Replication for the table (Database → Replication) or you won't get events at all in production, even though local seems to work.
The push. Of course. sam_builds · edited
Also remove the channel in the effect cleanup, otherwise in dev with StrictMode you get two subscriptions and every insert shows up twice. jb_supa · edited