Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charlesstover/with-router
A pub-sub alternative HOC to react-router's withRouter HOC.
https://github.com/charlesstover/with-router
npm npmjs react react-router reactjs travis travis-ci travisci
Last synced: about 1 month ago
JSON representation
A pub-sub alternative HOC to react-router's withRouter HOC.
- Host: GitHub
- URL: https://github.com/charlesstover/with-router
- Owner: CharlesStover
- License: mit
- Archived: true
- Created: 2018-10-26T21:20:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-24T04:21:09.000Z (over 2 years ago)
- Last Synced: 2024-09-26T00:36:08.796Z (about 1 month ago)
- Topics: npm, npmjs, react, react-router, reactjs, travis, travis-ci, travisci
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/with-router
- Size: 140 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# withRouter [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Do%20you%20wish%20that%20withRouter%20would%20rerender%20your%20component%20when%20your%20route%20changes?%20Now%20it%20can%20with%20the%20with-router%20NPM%20package!&url=https://github.com/CharlesStover/with-router&via=CharlesStover&hashtags=react,reactjs,javascript,webdev,webdeveloper,webdevelopment)
A pub-sub alternative HOC to `react-router`'s `withRouter` HOC. It functions exactly the same way, except the wrapped component will re-render when the route changes. This is beneficial if your view changes depending on the current path.
[![version](https://img.shields.io/npm/v/with-router.svg)](https://www.npmjs.com/package/with-router)
[![minified size](https://img.shields.io/bundlephobia/min/with-router.svg)](https://www.npmjs.com/package/with-router)
[![minzipped size](https://img.shields.io/bundlephobia/minzip/with-router.svg)](https://www.npmjs.com/package/with-router)
[![downloads](https://img.shields.io/npm/dt/with-router.svg)](https://www.npmjs.com/package/with-router)
[![build](https://api.travis-ci.com/CharlesStover/with-router.svg)](https://travis-ci.com/CharlesStover/with-router/)## Install
* `npm install with-router --save` or
* `yarn add with-router`## Use
Use it the same way you would use `react-router`'s built-in `withRouter` HOC!