That's how traditional SSR applications work.
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.
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.