# react-router-dom-intl

> Package intent to get localized Routes.

Latest version **0.1.3** (published 2021-05-26) · 0 weekly downloads

## Install

```sh
npm install react-router-dom-intl
pnpm add react-router-dom-intl
yarn add react-router-dom-intl
bun add react-router-dom-intl
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2021-05-26 |
| First published | 2021-05-26 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | hollypony |

## Links

- npm: https://www.npmjs.com/package/react-router-dom-intl
- Repository: https://github.com/HollyPony/react-router-dom-intl
- Homepage: https://github.com/HollyPony/react-router-dom-intl#readme
- Issues: https://github.com/HollyPony/react-router-dom-intl/issues
- npm.io page: https://npm.io/package/react-router-dom-intl

## Dependencies (1)

- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.14.3

## Recent versions

- 0.1.3 (latest) — 2021-05-26
- 0.1.2 — 2021-05-26
- 0.1.1 — 2021-05-26
- 0.1.0 — 2021-05-26

## README

## React Router Dom Intl

Package intent to get localized Routes.

Use `Link` and `Switch` components from this package and let the magic happen.

### Warning

> In this early version only `<Link to={String} />` are supported. Not the `Object{pathname}` syntax. This will come in v1.

## Basic usage

```js
<IntlProvider
  locale="fr"
  defaultLocale="fr"
  messages={{
    '/route1': '/chemin1', // Localize your path here
  }}>
  <BrowserRouter>
    <ul>
      <li>
        <Link to="/">Link to /</Link>
      </li>
      <li>
        <Link to="/route1">Link to /route1 see the url link</Link>
      </li>
      <li>
        <Link to="/route2">Link to /route2</Link>
      </li>
    </ul>

    <Switch>
      <Route exact path="/"><div>base route</div></Route>
      <Route path="/route1"><div>route 1</div></Route>{/* Will be translated to '/chemin1' according to "messages" */}
      <Route path="/route2"><div>route 2</div></Route>{/* Stay provided path since it's not provided */}
    </Switch>
  </BrowserRouter>
</IntlProvider>
```

See src/index.js for sample and src/lib for logic or `npm run start` this project locally for a demo.

---
_Source: https://npm.io/package/react-router-dom-intl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
