To replace the HTML of some part of the page with new HTML that has been generated on the server, please use a region with data-wp-router-region and the actions.navigate action from the @wordpress/interactivity-router package.
More info on the docs: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity-router/