react-router#generatePath TypeScript Examples

The following examples show how to use react-router#generatePath. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: routes.ts    From master-frontend-lemoncode with MIT License 5 votes vote down vote up
linkRoutes: LinkRoutes = {
  ...switchRoutes,
  hotelEdit: id => generatePath(switchRoutes.hotelEdit, { id }),
}
Example #2
Source File: routes.ts    From master-frontend-lemoncode with MIT License 5 votes vote down vote up
linkRoutes: LinkRoutes = {
  ...switchRoutes,
  editHotel: (id) => generatePath(switchRoutes.editHotel, { id }),
}
Example #3
Source File: BadgesClient.ts    From backstage with Apache License 2.0 5 votes vote down vote up
private async getEntityBadgeSpecsUrl(entity: Entity): Promise<string> {
    const routeParams = this.getEntityRouteParams(entity);
    const path = generatePath(`:namespace/:kind/:name`, routeParams);
    return `${await this.discoveryApi.getBaseUrl(
      'badges',
    )}/entity/${path}/badge-specs`;
  }