So js framework separates the render function which renders html and the client-side only part (count event) for you. This akin to what I said earlier. The same missing piece here is effect (e.g. http) that actually transfer state from client to sever and persist to storage. The business logic for client-only is not going to be exactly business logic for behind-the-wall rules. Some may be shared but that's not really significant; it's going to be things like optimistic ui.
vdom keeps being mentioned, but it doesn't matter here because it's implementation detail, other frameworks will do it differently.
I don't see it's ended up being different than js as yet another backend language with a separate js for volatile state on ui.