Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/api/data-routers/createStaticRouter.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ function createStaticRouter(
opts: {
branches?: RouteBranch<DataRouteObject>[];
future?: Partial<FutureConfig>;
} = ,
): DataRouter {}
} = {},
): DataRouter
```

## Params
Expand Down
2 changes: 1 addition & 1 deletion docs/api/framework-conventions/react-router.config.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ order: 3
This file is optional
</docs-info>

[Reference Documentation ↗](https://api.reactrouter.com/v7/types/_react-router_dev.config.Config.html)
[Reference Documentation ↗](https://api.reactrouter.com/v8/types/_react-router_dev.config.Config.html)

React Router framework configuration file that lets you customize aspects of your React Router application like server-side rendering, directory locations, and build settings.

Expand Down
12 changes: 6 additions & 6 deletions docs/api/framework-conventions/routes.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ order: 2
This file is required
</docs-info>

[Reference Documentation ↗](https://api.reactrouter.com/v7/interfaces/_react-router_dev.routes.RouteConfigEntry.html)
[Reference Documentation ↗](https://api.reactrouter.com/v8/interfaces/_react-router_dev.routes.RouteConfigEntry.html)

Configuration file that maps URL patterns to route modules in your application.

Expand Down Expand Up @@ -59,9 +59,9 @@ export default flatRoutes() satisfies RouteConfig;
### Route Helpers

[routing]: ../../start/framework/routing
[route]: https://api.reactrouter.com/v7/functions/_react-router_dev.routes.route.html
[index]: https://api.reactrouter.com/v7/functions/_react-router_dev.routes.index.html
[layout]: https://api.reactrouter.com/v7/functions/_react-router_dev.routes.layout.html
[prefix]: https://api.reactrouter.com/v7/functions/_react-router_dev.routes.prefix.html
[relative]: https://api.reactrouter.com/v7/functions/_react-router_dev.routes.relative.html
[route]: https://api.reactrouter.com/v8/functions/_react-router_dev.routes.route.html
[index]: https://api.reactrouter.com/v8/functions/_react-router_dev.routes.index.html
[layout]: https://api.reactrouter.com/v8/functions/_react-router_dev.routes.layout.html
[prefix]: https://api.reactrouter.com/v8/functions/_react-router_dev.routes.prefix.html
[relative]: https://api.reactrouter.com/v8/functions/_react-router_dev.routes.relative.html
[file-route-conventions]: ../../how-to/file-route-conventions
2 changes: 1 addition & 1 deletion docs/api/hooks/useFetcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function useFetcher<T = any>({
key,
}: {
key?: string;
} = ): FetcherWithComponents<SerializeFrom<T>> {}
} = {}): FetcherWithComponents<SerializeFrom<T>>
```

## Params
Expand Down
4 changes: 2 additions & 2 deletions docs/api/hooks/useFormAction.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ function useFormAction(
relative,
}: {
relative?: RelativeRoutingType;
} = ,
): string {}
} = {},
): string
```

## Params
Expand Down
4 changes: 2 additions & 2 deletions docs/api/hooks/useHref.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function useHref(
relative,
}: {
relative?: RelativeRoutingType;
} = ,
): string {}
} = {},
): string
```

## Params
Expand Down
4 changes: 2 additions & 2 deletions docs/api/hooks/useLinkClickHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ function useLinkClickHandler<E extends Element = HTMLAnchorElement>(
viewTransition?: boolean;
defaultShouldRevalidate?: boolean;
useTransitions?: boolean;
} = ,
): (event: React.MouseEvent<E, MouseEvent>) => void {}
} = {},
): (event: React.MouseEvent<E, MouseEvent>) => void
```

## Params
Expand Down
4 changes: 2 additions & 2 deletions docs/api/hooks/useResolvedPath.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ function useResolvedPath(
relative,
}: {
relative?: RelativeRoutingType;
} = ,
): Path {}
} = {},
): Path
```

## Params
Expand Down
4 changes: 2 additions & 2 deletions docs/api/hooks/useViewTransitionState.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ function useViewTransitionState(
relative,
}: {
relative?: RelativeRoutingType;
} = ,
) {}
} = {},
)
```

## Params
Expand Down
8 changes: 4 additions & 4 deletions docs/api/other-api/adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Each adapter has the same API. Some adapters also have options specific to the p

## `@react-router/express`

[Reference Documentation ↗](https://api.reactrouter.com/v7/modules/_react-router_express.html)
[Reference Documentation ↗](https://api.reactrouter.com/v8/modules/_react-router_express.html)

Here's an example with [Express][express]:

Expand Down Expand Up @@ -124,7 +124,7 @@ Make sure that `--conditions development` is included in the `dev` script so tha

## `@react-router/architect`

[Reference Documentation ↗](https://api.reactrouter.com/v7/modules/_react-router_architect.html)
[Reference Documentation ↗](https://api.reactrouter.com/v8/modules/_react-router_architect.html)

Here's an example with Architect:

Expand All @@ -139,7 +139,7 @@ export const handler = createRequestHandler({

## `@react-router/cloudflare`

[Reference Documentation ↗](https://api.reactrouter.com/v7/modules/_react-router_cloudflare.html)
[Reference Documentation ↗](https://api.reactrouter.com/v8/modules/_react-router_cloudflare.html)

Here's an example with Cloudflare:

Expand Down Expand Up @@ -173,7 +173,7 @@ export default {

While not a direct "adapter" like the above, this package contains utilities for working with Node-based adapters.

[Reference Documentation ↗](https://api.reactrouter.com/v7/modules/_react-router_node.html)
[Reference Documentation ↗](https://api.reactrouter.com/v8/modules/_react-router_node.html)

### Node Version Support

Expand Down
35 changes: 34 additions & 1 deletion docs/api/utils/IsCookieFunction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,41 @@ title: IsCookieFunction

# IsCookieFunction

<!--
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️

Thank you for helping improve our documentation!

This file is auto-generated from the JSDoc comments in the source
code, so please edit the JSDoc comments in the file below and this
file will be re-generated once those changes are merged.

https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/server-runtime/cookies.ts
-->

[MODES: framework, data]

## Summary

[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.IsCookieFunction.html)
[Reference Documentation ↗](https://api.reactrouter.com/v8/types/react-router.IsCookieFunction.html)

A function that determines whether a value is a React Router [`Cookie`](https://api.reactrouter.com/v8/interfaces/react-router.Cookie.html)
object.

## Signature

```tsx
type IsCookieFunction = (object: any) => object is Cookie;
```

## Params

### object

The value to check.

## Returns

`true` if the value is a React Router [`Cookie`](https://api.reactrouter.com/v8/interfaces/react-router.Cookie.html) object;
otherwise, `false`.

35 changes: 34 additions & 1 deletion docs/api/utils/IsSessionFunction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,41 @@ title: IsSessionFunction

# IsSessionFunction

<!--
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️

Thank you for helping improve our documentation!

This file is auto-generated from the JSDoc comments in the source
code, so please edit the JSDoc comments in the file below and this
file will be re-generated once those changes are merged.

https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/server-runtime/sessions.ts
-->

[MODES: framework, data]

## Summary

[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.IsSessionFunction.html)
[Reference Documentation ↗](https://api.reactrouter.com/v8/types/react-router.IsSessionFunction.html)

A function that determines whether a value is a React Router [`Session`](https://api.reactrouter.com/v8/interfaces/react-router.Session.html)
object.

## Signature

```tsx
type IsSessionFunction = (object: any) => object is Session;
```

## Params

### object

The value to check.

## Returns

`true` if the value is a React Router [`Session`](https://api.reactrouter.com/v8/interfaces/react-router.Session.html) object;
otherwise, `false`.

29 changes: 28 additions & 1 deletion docs/api/utils/createCookie.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,37 @@ title: createCookie

# createCookie

<!--
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️

Thank you for helping improve our documentation!

This file is auto-generated from the JSDoc comments in the source
code, so please edit the JSDoc comments in the file below and this
file will be re-generated once those changes are merged.

https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/server-runtime/cookies.ts
-->

[MODES: framework, data]

## Summary

[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.createCookie.html)
[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.createCookie.html)

Creates a logical container for managing a browser cookie from the server.

## Params

### name

The name of the cookie.

### cookieOptions

Options for parsing and serializing the cookie.

## Returns

A [`Cookie`](https://api.reactrouter.com/v8/interfaces/react-router.Cookie.html) object for parsing and serializing the cookie.

34 changes: 33 additions & 1 deletion docs/api/utils/createCookieSessionStorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@ title: createCookieSessionStorage

# createCookieSessionStorage

<!--
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️

Thank you for helping improve our documentation!

This file is auto-generated from the JSDoc comments in the source
code, so please edit the JSDoc comments in the file below and this
file will be re-generated once those changes are merged.

https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/server-runtime/sessions/cookieStorage.ts
-->

[MODES: framework, data]

## Summary

[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.createCookieSessionStorage.html)
[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.createCookieSessionStorage.html)

Creates and returns a SessionStorage object that stores all session data
directly in the session cookie itself.
Expand All @@ -17,3 +29,23 @@ This has the advantage that no database or other backend services are
needed, and can help to simplify some load-balanced scenarios. However, it
also has the limitation that serialized session data may not exceed the
browser's maximum cookie size. Trade-offs!

## Signature

```tsx
function createCookieSessionStorage<Data = SessionData, FlashData = Data>({
cookie: cookieArg,
}: CookieSessionStorageOptions = {}): SessionStorage<Data, FlashData>
```

## Params

### options

Options for creating the cookie-backed session storage.

## Returns

A [`SessionStorage`](https://api.reactrouter.com/v8/interfaces/react-router.SessionStorage.html) object that stores all session data in its
cookie.

40 changes: 35 additions & 5 deletions docs/api/utils/createMemorySessionStorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,44 @@ title: createMemorySessionStorage

# createMemorySessionStorage

<!--
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️

Thank you for helping improve our documentation!

This file is auto-generated from the JSDoc comments in the source
code, so please edit the JSDoc comments in the file below and this
file will be re-generated once those changes are merged.

https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/server-runtime/sessions/memoryStorage.ts
-->

[MODES: framework, data]

## Summary

[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.createMemorySessionStorage.html)
[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.createMemorySessionStorage.html)

Creates and returns a simple in-memory SessionStorage object.

Intended for local development and testing. It does not scale beyond a single
process, and all session data is lost when the server process stops/restarts.

## Signature

```tsx
function createMemorySessionStorage<Data = SessionData, FlashData = Data>({
cookie,
}: MemorySessionStorageOptions = {}): SessionStorage<Data, FlashData>
```

## Params

### options

Options for creating the in-memory session storage.

## Returns

Creates and returns a simple in-memory SessionStorage object, mostly useful
for testing and as a reference implementation.
A [`SessionStorage`](https://api.reactrouter.com/v8/interfaces/react-router.SessionStorage.html) object that stores session data in memory.

Note: This storage does not scale beyond a single process, so it is not
suitable for most production scenarios.
Loading
Loading