Skip to content

Format react routes containing parameters. Can be used with react itself, Gatsby, Nextjs

Notifications You must be signed in to change notification settings

Ikpeba4ll/format-react-route

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Format react routes containing parameters. Can be used with react itself, Gatsby, Nextjs

How to Install

npm i format-react-route

Usage

const { formatRoute } = require("format-react-route");

or

import { formatRoute } from "format-react-route";

const url = "index/:id/:key/:word";
const opt = { id: 45, key: "200k", word: "kofi" };

<Link to={formatRoute(url, opt)} />

About

Format react routes containing parameters. Can be used with react itself, Gatsby, Nextjs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published