Update React frontend data to reflect changes to MySQL server
P粉384679266
P粉384679266 2023-08-16 00:03:49
0
1
423

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.

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粉384679266
P粉384679266

reply all (1)
P粉946336138

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.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!