# react-router-apply-middleware

> Composable middleware for React Router

Latest version **0.0.2** (published 2016-03-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-router-apply-middleware
pnpm add react-router-apply-middleware
yarn add react-router-apply-middleware
bun add react-router-apply-middleware
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2016-03-19 |
| First published | 2016-03-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 40 |
| Maintainers | ryanflorence |
| Keywords | react, react router, middleware |

## Links

- npm: https://www.npmjs.com/package/react-router-apply-middleware
- Repository: https://github.com/ryanflorence/react-router-apply-middleware
- Homepage: https://github.com/ryanflorence/react-router-apply-middleware#readme
- Issues: https://github.com/ryanflorence/react-router-apply-middleware/issues
- npm.io page: https://npm.io/package/react-router-apply-middleware

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2016-03-19
- 0.0.1 — 2016-03-19

## README

# React Router Apply Middleware

This is a WIP with only a couple hours put into the code, but I think it
works, give it a shot, send some pull requests if you run into issues.

## Installation

```
npm install react-router-apply-middleware
```

## Usage

```js
import applyRouterMiddleware from 'react-router-apply-middleware'
import { useAsyncProps } from 'react-router-async-props'
import { useRelativeLinks } from 'react-router-relative-links'
import { useNamedRoutes } from 'react-router-named-routes'
import routes from './routes'

const renderWithMiddleware = applyRouterMiddleware(
  useAsyncProps(),
  useRelativeLinks(),
  useNamedRoutes(routes)
)

render(<Router render={renderWithMiddleware} routes={routes}/>, el)
```

## Writing Middleware

For now you'll have to look at the tests, it's a little bit tricky. As
soon as the middleware libs I'm working on are updated, I'll come add
some notes here about how to do it.

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