Skip to main content
reloadNuxtApp will perform a hard reload of your app, re-requesting a page and its dependencies from the server.
By default, it will also save the current state of your app (that is, any state you could access with useState).
You can enable experimental restoration of this state by enabling the experimental.restoreState option in your nuxt.config file.

Type Signature

function reloadNuxtApp(options?: ReloadNuxtAppOptions): void

interface ReloadNuxtAppOptions {
  ttl?: number
  force?: boolean
  path?: string
  persistState?: boolean
}

Parameters

options
ReloadNuxtAppOptions
Options object to configure the reload behavior.

Examples

Basic Reload

// Perform a simple reload
reloadNuxtApp()

Reload with Custom Path

// Reload and navigate to a different path
reloadNuxtApp({ path: '/dashboard' })

Force Reload

// Force a reload, bypassing the TTL protection
reloadNuxtApp({ force: true })

Reload with State Persistence

// Reload and persist the current state
reloadNuxtApp({ persistState: true })

See Also