Tweed Router
Universal Router for Tweed.
Installation
$ npm install --save tweed-router
Usage
const router = router
Render the router with Tweed's render
method to render the current page of the router
automatically:
{ thisrouter = router } { return <p> Home page! Go to thisrouterlink'the about page' '/about' </p> } const router = router <p>About page</p> router
To hook up the router to the browser's History API, use the BrowserRouter
like this:
const routes = router BrowserRouter
The router can also be used on the server using the ServerRouter
like so:
ServerRouter