# @talend/react-cmf-router

> This is the old router of react-cmf packaged as external dependency.

Latest version **8.0.3** (published 2025-10-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @talend/react-cmf-router
pnpm add @talend/react-cmf-router
yarn add @talend/react-cmf-router
bun add @talend/react-cmf-router
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 8.0.3 |
| Published | 2025-10-15 |
| First published | 2018-09-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 160 |
| Author | Talend Frontend |
| Maintainers | talend-frontend |

## Links

- npm: https://www.npmjs.com/package/@talend/react-cmf-router
- Repository: https://github.com/Talend/ui
- Homepage: https://github.com/Talend/ui#readme
- Issues: https://github.com/Talend/ui/issues
- npm.io page: https://npm.io/package/@talend/react-cmf-router

## Dependencies (10)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [history](https://npm.io/package/history.md) ^5.3.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.8.1
- [redux-saga](https://npm.io/package/redux-saga.md) ^1.3.0
- [react-redux](https://npm.io/package/react-redux.md) ^7.2.9
- [react-router](https://npm.io/package/react-router.md) ~6.3.0
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^8.3.0
- [react-router-dom](https://npm.io/package/react-router-dom.md) ~6.3.0
- [@talend/react-cmf](https://npm.io/package/@talend/react-cmf.md) ^11.0.2
- [connected-react-router](https://npm.io/package/connected-react-router.md) ^6.9.3

## Recent versions

- 8.0.3 (latest) — 2025-10-15
- 5.0.0-0 (next) — 2022-05-09
- 8.0.2 — 2025-06-27
- 8.0.1 — 2025-06-19
- 8.0.0 — 2024-12-31
- 7.1.1 — 2024-12-24
- 7.1.0 — 2024-12-10
- 7.0.1 — 2024-06-27
- 7.0.0 — 2024-06-13
- 6.2.0 — 2024-06-11
- 6.1.3 — 2024-05-22
- 6.1.2 — 2024-02-29
- 6.1.1 — 2023-12-01
- 6.1.0 — 2023-11-06
- 6.0.0 — 2023-10-24
- … 49 more at https://npm.io/package/@talend/react-cmf-router/versions

## README

# @talend/react-cmf-router

This is the old router of react-cmf packaged as external dependency.

## Setup

First add it to your bootstrap app

```javascript
import cmf from '@talend/react-cmf';
import getRouter from '@talend/react-cmf-router';

const routerFunctions = {
    // key for OnEnter/onLeave in router config: value is the function
};

const router = getRouter({ history, sagaRouterConfig, routerFunctions });

cmf.bootstrap({
    modules: [router.cmfModule],
    RootComponent: router.RootComponent,
});
```

If your project has multiple modules with `routerConfig` you can pass all of them to `getRouter()` the following way:


```javascript
const router = getRouter(config1, config2, config3);
```

The `getRouter` function will merge all of them to build the router configuration.

So be careful with the order since the next has a higher priority comparing to the previous config.

## routerAPI

routerAPI is an object which expose the following api:


| name | return type | description|
| -- | -- | -- |
| `routerAPI.selectors.getLocation(state)` | object | current [location object](https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/api/location.md) |
| `routerAPI.selectors.getPath(state)` | string |  the current path (a string) which is the fragment so you can apply matchPath to it |

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