0.1.2 • Published 4 years ago
next-router-component
Licence
MIT
Version
0.1.2
Deps
0
Size
14 kB
Vulns
0
Weekly
0
next-router-component
Component-based routing with Next.js.
Install
npm install next-router-component
Example
const Sample = () => {
return (
<div>
{/* The following two are just different ways of writing */}
<Route<{ id: string | string[] }>
path={'/catch-all/[id]'}
render={({ id }) => <h1>This page is {`/catch-all/${id}`}</h1>}
/>
<Route<{ id: string | string[] }> path={'/catch-all/[id]'}>
{({ id }) => <h1>This page is {`/catch-all/${id}`}</h1>}
</Route>
</div>
);
};