karet.router
v0.3.1
Published
Routing component for use with [Karet][karet].
Downloads
7
Maintainers
Readme
Karet Router
Routing component for use with Karet.
Usage
// app.js
import React from 'karet';
import { Router } from 'karet.router';
import { render } from 'react-dom';
const routes = {
'/': () =>
<div>Root page</div>,
'/subpage': () =>
<div>Sub-route</div>,
'/with-params/:id': ({ params }) =>
<div>Route with ID {params.id}</div>
};
const App = () => <Router routes={routes} />
render(
<App />,
document.getElementById('root'));