I’m currently working on the voting app and I’m having trouble getting the voting data back from the server in the way I want. I’m using all React to build the frontend, and for the component that handles the voting mechanism, there is a button that when you press it, it sends a form to the server containing the choice that was picked. It then goes into the database and updates the number of votes.
My issue is that with the same button press, I want to also fetch this updated data in a click handler so that I can render it in chart form, but I’m almost sure this is the incorrect way to do it. Does anyone have any ideas? Thanks in advance.