preact-doc-head
v1.0.0
Published
Control your document head
Downloads
3
Readme
preact-loadable-route
Load routes with dynamic imports
Example
import { h, Component } from "preact";
import Router from "preact-router";
import LoadableRoute from "preact-loadable-route";
class App extends Component<{}, {}> {
render() {
return (
<Router>
<LoadableRoute
loader={() => import("/path/to/home")}
loading={() => "Loading component"}
error={() => "Error"}
/>
</Router>
);
}
}