Interface: RouteStateOptions
Defined in: router/types.ts:26
The options of useRouteState. The defaults of source, history, clearOnDefault and mode come from the router options of the instance.
Properties
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
clearOnDefault? | boolean | true | Removes the param instead of writing a value equal to the parser default. | router/types.ts:50 |
history? | HistoryMode | 'replace' | How a write navigates. Writes made in the same tick become one navigation, which is pushed when any of them asks for 'push'. | router/types.ts:48 |
key | string | undefined | Names the state, and the param unless urlKey is given. | router/types.ts:28 |
missing? | unknown | the missing of the instance | What the ref reads without a value or a default, and what removes the param when written. A key set to undefined means undefined, and a key left out takes the one of the instance. | router/types.ts:37 |
mode? | StateMode | 'optimistic' | With 'optimistic', a write reads back at once and the URL takes over when the navigation lands, so a navigation a guard cancels returns the ref to what the URL holds. With 'source', every read goes to the current route. | router/types.ts:58 |
parser? | ParserInput | parseAsString | Turns the param into a value and determines the type of the ref. | router/types.ts:30 |
source? | RouteStateSource | 'query' | Which part of the route the state reads. | router/types.ts:41 |
urlKey? | string | the value of key | The name of the param in the URL. | router/types.ts:39 |