All Projects → CharlesStover → Use React Router

CharlesStover / Use React Router

Licence: mit
React Hook for pub-sub behavior using React Router.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Use React Router

Use Clippy
React Hook for reading from and writing to the user's clipboard.
Stars: ✭ 139 (-75.83%)
Mutual labels:  npm, travis-ci, travis
Use Force Update
React Hook to force your functional component to update.
Stars: ✭ 142 (-75.3%)
Mutual labels:  npm, travis-ci, travis
Quicksort Js
An implementation of Quicksort in JavaScript/TypeScript.
Stars: ✭ 60 (-89.57%)
Mutual labels:  npm, travis-ci, travis
Reactn
React, but with built-in global state management.
Stars: ✭ 1,906 (+231.48%)
Mutual labels:  npm, travis-ci, travis
Fetch Suspense
A React hook compatible with React 16.6's Suspense component.
Stars: ✭ 479 (-16.7%)
Mutual labels:  npm, travis-ci, travis
Lighthouse Badges
🚦Generate badges (shields.io) based on Lighthouse performance.
Stars: ✭ 150 (-73.91%)
Mutual labels:  npm, travis
Greenkeeper Lockfile
🔒 Your lockfile, up to date, all the time
Stars: ✭ 181 (-68.52%)
Mutual labels:  npm, travis-ci
travis-deploy-once
🚫Test multiple node versions on Travis. Deploy once. If all of them pass.
Stars: ✭ 34 (-94.09%)
Mutual labels:  travis-ci, travis
sbt-travisci
An sbt plugin to integrate with Travis CI
Stars: ✭ 44 (-92.35%)
Mutual labels:  travis-ci, travis
Notes
Some public notes
Stars: ✭ 1,248 (+117.04%)
Mutual labels:  npm, travis-ci
fetch-action-creator
Fetches using standardized, four-part asynchronous actions for redux-thunk.
Stars: ✭ 28 (-95.13%)
Mutual labels:  travis-ci, travis
react-testing-mocha-chai-enzyme
A solid test setup for React components with Mocha, Chai, Sinon, Enzyme in a Webpack/Babel application.
Stars: ✭ 48 (-91.65%)
Mutual labels:  travis-ci, travis
googletest-ci
Continuous integration (CI) + Google Test (gtest) + CMake example boilerplate demo
Stars: ✭ 14 (-97.57%)
Mutual labels:  travis-ci, travis
vagrant-travisci-libvrt
Example project showing how to run Vagrant on TravisCI using libvrt & KVM
Stars: ✭ 25 (-95.65%)
Mutual labels:  travis-ci, travis
yaspeller-ci
Fast spelling check for Travis CI
Stars: ✭ 60 (-89.57%)
Mutual labels:  travis-ci, travis
react-multi-context
Manage multiple React 16 contexts with a single component.
Stars: ✭ 19 (-96.7%)
Mutual labels:  travis-ci, travis
plugin.video.sendtokodi
📺 plays various stream sites on kodi using youtube-dl
Stars: ✭ 86 (-85.04%)
Mutual labels:  travis-ci, travis
Node Developer Boilerplate
🍭 Boilerplate for ES6+ Node.js and npm Developer
Stars: ✭ 82 (-85.74%)
Mutual labels:  npm, travis-ci
badge-matrix
More advanced badges for projects using Travis or Sauce Labs
Stars: ✭ 77 (-86.61%)
Mutual labels:  travis-ci, travis
todo-list
TodoList using Ionic2/3 & Firebase: * PWA * SSO Google plus. * Share list via QRcode. * Upload image from Camera or Storage. * Speech Recognition.
Stars: ✭ 18 (-96.87%)
Mutual labels:  travis-ci, travis

useReactRouter Tweet version minzipped size downloads build

useReactRouter is a React Hook that provides pub-sub behavior for react-router. Unlike the withRouter Higher-Order Component, useReactRouter will re-render your component when the location changes!

useReactRouter() returns an object that contains the history, location, and match properties that would be passed as props by the HOC.

A tutorial covering the design and development of this package can be found on Medium: How to Convert withRouter to a React Hook.

Why Pub-Sub?

Pub-sub behavior is a common request (that's commonly rejected) for the react-router package.

For users who adamently prefer pub-sub behavior over react-router's suggested alternatives, this package offers a solution.

A non-pub-sub React Hook is anticipated to eventually be included in the react-router package itself.

Install

You must be using react-router and react-router-dom v5.0.0 or greater.

  • npm install use-react-router or
  • yarn add use-react-router

Use

Import useReactRouter and use it as a React Hook.

import useReactRouter from 'use-react-router';

const MyPath = () => {
  const { history, location, match } = useReactRouter();
  return (
    <div>
      My location is {location.pathname}!
    </div>
  );
};

Sponsor 💗

If you are a fan of this project, you may become a sponsor via GitHub's Sponsors Program.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].