search

Home  >  Q&A  >  body text

Update React frontend data to reflect changes to MySQL server

<p>I am currently working on a web application using React to build the frontend and SpringBoot to build the backend. I have built a backend REST API that interacts with a MySQL database. My problem is that I want my data to be refreshed/reloaded on the frontend when something changes in the backend database. </p> <p>I looked up some tutorials online about using WebSockets, but they confused me even more. Does anyone have experience with this type of problem/any solutions? A solution for WebSockets is also available. </p>
P粉384679266P粉384679266507 days ago547

reply all(1)I'll reply

  • P粉946336138

    P粉9463361382023-08-16 21:56:07

    A simple solution is polling. In the client you can get data from the backend every 5 seconds to check if there is new content.

    There are many solutions to this problem, depending on your use case.

    reply
    0
  • Cancelreply