Best way to update data or trigger events in react client from server?

I’ve been avoiding and also trying to figure out this obstacle for quite some times now, but recently decided to try and get acquainted with React. After trying and failing a bunch of different times, I’m starting to vaguely understand thanks to the Glitch :・゚✧ project.

However, now that I’ve got that- a server set up on the back end and a client on the front end, what’s the best way to push data to the client? For example updating a number on screen as the database is updated, or triggering a sound to play when the server picks up some other trigger?

I know this could be achieved by telling the client to make fetch requests to an endpoint on the server every 5 seconds or so, and have the server save a queue of events to send back as a response, but this doesn’t ~feel~ like the most optimal way to do it… That being said, I am not a web developer, so I’ll leave that assessment up to smarter people than I…! :grin:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.