light-react-router
v1.2.2
Published
Lite react router
Downloads
3
Readme
Instalation
npm i light-react-router --save
Usage
index.js:
import React from 'react';
import { Link, Route } from 'light-react-router';
export default function Main() {
return (
<Route href="/">
<Link href="/about">About page</Link>
</Route>
);
}
about.js:
import React from 'react';
import { Route } from 'light-react-router';
let Lazy = React.lazy(() => import('./about_lazy'));
export default function About() {
return (
<Route href="/about">
<Lazy />
</Route>
);
}
about_lazy.js:
import React from 'react';
export default function AboutLazy() {
return <h1>WOW!</h1>;
}