Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

mjanssen/preact-route-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

12 Commits

Repository files navigation

Preact route async

npm gzip size

Asynchronous loading for Preact Router. For 440B.

Inspired by preact-async-route. Bundled with πŸ“¦ Microbundle

Install

npm install --save preact-route-async

Usage

import Router from 'preact-router';
import Route from 'preact-route-async';
<Router>
 <Route path="/" component={Home} />
 <Route
 path="/user"
 user={user}
 getComponent={() => import('./pages/user.js')}
 />
</Router>

Options

Props and children wil automatically be passed to the fetched Component. The library also passes the path property, coming from preact-router to the Component.

Demo

Code demo can be found here

License

MIT

About

Easy asynchronous loading for your router components. For 440B.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /