Function hardNavigate

  • Navigates the browser to a specified route by updating the window.location.href. This function performs a hard navigation, causing the browser to reload the page at the specified URL.

    Parameters

    • route: string

      The URL or path to navigate to. It should be a valid string representing the destination route.

    • basePath: string = ''

      An optional base path to prepend to the route. Defaults to an empty string.

    Returns void

    Use this function when you need to perform a full page reload or navigate to an external site. For single-page applications (SPAs), consider using a client-side routing solution instead.