If your UI is rendered on the server, then your UI state remains on the server. It just ferries that state to the client. There's no synchronization involved because it's synchronized by default.
The new way is html over the wire e.g. Hotwire, Liveview, htmx. So instead of the page being reloaded, the section of the UI that needs to updated is rendered on the server and sent over via websocket.
So might not be the best approach unless most of your users are at their desk
To your original question, my proposal is that html over the wire provides a good solution without the need for state to reside and change in client JS.