How do I update app data?

Hello!

I am still trying to do user authentication. My router returns different routes depending on isAuthenticated.

But the problem is that Framework7 is already ready when useAuth() returns a token and isAuthenticated is set to false, not waiting for a token. Is it possible to somehow change the routes of the application when the data finally comes up? Do not add, but completely replace. And pass user data to the application.

const MyApp = () => {

    let {token, login, logout, userId, ready} = useAuth()
    let isAuthenticated = !!token
    let routes = useRoutes(isAuthenticated)


  // Framework7 Parameters
  let f7params = {
    token: token,
    name: 'VOL Messenger', 
    ....
  };
 if (!ready) {
    return (
        <App { ...f7params }>
            <Loader />
        </App>
    )
}

f7params.name = "dddd"
f7params.ready = ready
f7params.routes = routes
console.log(f7)

  return (
  <App { ...f7params }>
    {/* Your main view, should have "view-main" class */}
    <View main className="safe-areas" url="/" />
  </App>
  );
}
export default MyApp;

You can try:

First, don’t render the View when routes are not ready:

<App { ...f7params }>
    {routesAreReady && (
      <View main className="safe-areas" url="/" />
    )}
</App>

Yes, you can update f7 params.routes later, but do it before you render the View:

import { f7, f7ready } from 'framework7-react';

// and when you are ready to change routes
f7ready(() => {
  f7.params.routes = [...new routes]
})

Thank you. Is it possible to transfer these routes to a router? I did as you said, but when I try to redirect the logged in user from the /login page to the /home page, nothing happens. I take the router from f7.views.main.router, but there they have not been updated and there is no necessary route.