Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.06 KB

File metadata and controls

31 lines (21 loc) · 1.06 KB
title usePreloadRoute

usePreloadRoute 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