inferno-route
v1.1.20
Published
Another routing library for [Inferno](https://github.com/infernojs/inferno).
Downloads
3
Readme
inferno-route
Another routing library for Inferno.
- Incredibly lightweight (with only 1 component
Route
) - TypeScript friendly
Installation
npm install --save inferno-route
Usage
import Component from "inferno-component"
import Route from "inferno-route"
class User extends Component<any, {}> {
render() {
return this.props.params.id
}
}
// Set your entry point, like "#/", "#/1/2", "#/users/wizawu"
if (!window.location.hash) window.history.replaceState(null, null, "#/")
Inferno.render((
<Route path="#" component={Root}>
<Route path="1" component={First}>
<Route path="2" component={Second}>
<Route path="3" component={Third} />
</Route>
</Route>
<Route path="users/:id" component={User} />
<Route path="profile/.*" component={Profile} />
</Route>
), document.body.firstChild)
Issues
Please email to [email protected]. Open source soon.