Helpers

Alias @typed-router exports a helpers util that can be useful in places where there is no autocomplete yet. It simply returns the route you give as argument.

helpers.route

It will give you autocomplete and type check for route object

import {helpers} from '@typed-router';

const route = helpers.route({name: 'admin-id'}) // Error ❌
const route = helpers.route({name: 'admin-id', params: {id: 1}}) // Good ✅

helpers.path

It will give you autocomplete and type check for string path

import {helpers} from '@typed-router';

const route = helpers.path('/admin') // Error ❌
const route = helpers.path('/admin/1') // Good ✅
Table of Contents