1.0.0-rc.2 • Published 5 years ago
strict-routes v1.0.0-rc.2
Have you ever broken a link in your app with a stupid typo or by overlooking? No more.
Usage
import { strictRoutes } from 'strict-routes';
type Routes =
| '/'
| 'posts/{postId}'
| 'posts/{postId:number}/{commentId:string}'
const { navigate } = strictRoutes<Routes>()({
navigate:
})
navigate({ path: 'posts/{postId}', postId: 1 });
Installation
yarn add strict-routes
npm install strict-routes
TypeScript Version
Because strict-routes
is using template literal types it works with TypeScript 4.1 or newer.
1.0.0-rc.2
5 years ago
1.0.0-rc.0
5 years ago