usePreloadRoute
Edit this pageusePreloadRoute returns a function that can be used to preload a route manually.
const preload = usePreloadRoute();
preload(`/users/settings`, { preloadData: true });Usage
Routes are preloaded by default within Solid Router contexts. This helper is useful when you want to preload a route in response to some other event, such as a button click or a timer.
Type Signature
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
to | To | Yes | The route path to preload |
options | object | No | Configuration options for preloading |
Options
| Option | Type | Default | Description |
|---|---|---|---|
preloadData | boolean | false | Whether to preload the route's data in addition to the route itself |