Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/insin/react-router-active-component

Factory function for React components which are active for a particular React Router route
https://github.com/insin/react-router-active-component

react react-component react-router

Last synced: 13 days ago
JSON representation

Factory function for React components which are active for a particular React Router route

Awesome Lists containing this project

README

        

## React Router Active Component

[![Travis][build-badge]][build]
[![Codecov][coverage-badge]][coverage]
[![npm package][npm-badge]][npm]

A factory function for creating [React](http://facebook.github.io/react) components which get a special `className` when a specified [React Router](https://github.com/rackt/react-router) route is active, and can also handle creating a link to the route.

The primary use case for this module is making it convenient to create components which contain a link to a route but put the active class name on the container rather than the link:

**Using React Router's `Link` component:**

```html