diff --git a/src/routes/solid-router/reference/data-apis/response-helpers.mdx b/src/routes/solid-router/reference/data-apis/response-helpers.mdx index 568e8dc2a..2823cd61f 100644 --- a/src/routes/solid-router/reference/data-apis/response-helpers.mdx +++ b/src/routes/solid-router/reference/data-apis/response-helpers.mdx @@ -2,6 +2,9 @@ title: Response helpers --- +**Note:** These response helpers must be called within a `cache` or `action` function. If you want to +programmatically navigate, you will want to use the [useNavigate](/solid-router/reference/primitives/use-navigate) primitive. + ## Redirect Signature: `redirect(path, options)` diff --git a/src/routes/solid-router/reference/primitives/use-navigate.mdx b/src/routes/solid-router/reference/primitives/use-navigate.mdx index 76f9e2186..fd1e6da6d 100644 --- a/src/routes/solid-router/reference/primitives/use-navigate.mdx +++ b/src/routes/solid-router/reference/primitives/use-navigate.mdx @@ -17,8 +17,11 @@ if (unauthorized) { } ``` +If you are inside of a `cache` or `action` function you will instead want to use [redirect](/solid-router/reference/data-apis/response-helpers#redirect) or [reload](/solid-router/reference/data-apis/response-helpers#reload). + The state is serialized using the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) which does not support all object types. +