1.1.20 • Published 7 years ago

inferno-route v1.1.20

Weekly downloads
37
License
-
Repository
github
Last release
7 years ago

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 wizawu@gmail.com. Open source soon.

1.1.20

7 years ago

1.1.18

7 years ago

1.1.16

7 years ago

1.1.14

7 years ago

1.1.12

7 years ago

1.1.10

7 years ago

1.1.8

7 years ago

1.1.6

7 years ago

1.1.4

7 years ago

1.1.2

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago