1.0.0-rc.2 • Published 4 years ago

strict-routes v1.0.0-rc.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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.