pub(super) fn _thaw(
        &self,
        new_frozen_app: &str,
        thaw_prefs: ThawPrefs,
        is_hsr: bool,
    ) -> Result<(), ClientError> {
        // This won't check the data model, just that it is valid in some Perseus app
        // that could exist (therefore fine with HSR)
        let new_frozen_app: FrozenApp = serde_json::from_str(new_frozen_app)
            .map_err(|err| ClientThawError::InvalidFrozenApp { source: err })?;
        let route = new_frozen_app.route.clone();
        // Update our current frozen app
        let mut frozen_app = self.frozen_app.borrow_mut();
        *frozen_app = Some((new_frozen_app, thaw_prefs, is_hsr));
        // Better safe than sorry
        drop(frozen_app);

        if let Some(frozen_route) = route {
            let curr_route = match &*self.router_state.get_load_state_rc().get_untracked() {
                // If we've loaded a page, or we're about to, only change the route if necessary
                RouterLoadState::Loaded { path, .. } | RouterLoadState::Loading { path, .. } => {
                    path.clone()
                }
                // Since this function is only defined on the browser-side, this should
                // be completely impossible (note that the user can't change the router
                // state manually)
                RouterLoadState::Server => unreachable!(),
            };
            // If we're on the same page, just reload, otherwise go to the frozen route
            if curr_route == frozen_route {
                // We need to do this to get the new frozen state (dependent on thaw prefs)
                self.router_state.reload();
            } else {
                navigate(&frozen_route);
            }
        } else {
            self.router_state.reload();
        }

        Ok(())
    }
Internal underlying thaw logic (generic over HSR).
packages/perseus/src/reactor/state.rs