Unverified Commit 61672d96 authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[docs] Add `RedirectType` usage example to `permanentRedirect` (#89833)

Co-authored-by: 's avatarCursor Agent <cursoragent@cursor.com>
parent 0cc93871
......@@ -29,6 +29,16 @@ permanentRedirect(path, type)
By default, `permanentRedirect` will use `push` (adding a new entry to the browser history stack) in [Server Actions](/docs/app/getting-started/updating-data) and `replace` (replacing the current URL in the browser history stack) everywhere else. You can override this behavior by specifying the `type` parameter.
The `RedirectType` object contains the available options for the `type` parameter.
```ts
import { permanentRedirect, RedirectType } from 'next/navigation'
permanentRedirect('/redirect-to', RedirectType.replace)
// or
permanentRedirect('/redirect-to', RedirectType.push)
```
The `type` parameter has no effect when used in Server Components.
## Returns
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment