If you have a UI, you have UI state, so you’ll have to synchronise it somehow
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.
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.
So might not be the best approach unless most of your users are at their desk