{"id":13437809,"url":"https://github.com/acdlite/redux-router","last_synced_at":"2026-03-13T20:12:54.959Z","repository":{"id":48874256,"uuid":"38952298","full_name":"acdlite/redux-router","owner":"acdlite","description":"Redux bindings for React Router – keep your router state inside your Redux store","archived":false,"fork":false,"pushed_at":"2021-07-07T15:13:36.000Z","size":215,"stargazers_count":2291,"open_issues_count":31,"forks_count":196,"subscribers_count":49,"default_branch":"master","last_synced_at":"2026-03-04T19:45:26.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acdlite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-12T06:23:34.000Z","updated_at":"2026-02-08T14:40:07.000Z","dependencies_parsed_at":"2022-08-19T14:51:49.994Z","dependency_job_id":null,"html_url":"https://github.com/acdlite/redux-router","commit_stats":null,"previous_names":["rackt/redux-router","acdlite/redux-react-router"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/acdlite/redux-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acdlite%2Fredux-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acdlite%2Fredux-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acdlite%2Fredux-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acdlite%2Fredux-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acdlite","download_url":"https://codeload.github.com/acdlite/redux-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acdlite%2Fredux-router/sbom","scorecard":{"id":162519,"data":{"date":"2025-08-11","repo":{"name":"github.com/acdlite/redux-router","commit":"1a302fb057f37b4a388793b531ddddd38051900d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":4,"reason":"Found 6/15 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T13:54:12.666Z","repository_id":48874256,"created_at":"2025-08-16T13:54:12.666Z","updated_at":"2025-08-16T13:54:12.666Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30417177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T04:41:02.746Z","status":"ssl_error","status_checked_at":"2026-03-12T04:40:12.571Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:00.389Z","updated_at":"2026-03-13T20:12:54.937Z","avatar_url":"https://github.com/acdlite.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized","Code Design","JavaScript","React Integration","Stale"],"sub_categories":["Uncategorized","Router","Routing","JS Libraries \u0026 Utilities"],"readme":"redux-router\n============\n\n[![build status](https://img.shields.io/travis/acdlite/redux-router/master.svg?style=flat-square)](https://travis-ci.org/acdlite/redux-router)\n[![npm version](https://img.shields.io/npm/v/redux-router.svg?style=flat-square)](https://www.npmjs.com/package/redux-router)\n[![redux-router on discord](https://img.shields.io/badge/discord-redux--router@reactiflux-738bd7.svg?style=flat-square)](https://discord.gg/0ZcbPKXt5bVkq8Eo)\n\n## This project is experimental.\n\n### For bindings for React Router 1.x see [here](https://github.com/acdlite/redux-router/tree/263f623f6e8a8ec165568216888e572a48c5cd54)\n\n### In most cases, you don’t need any library to bridge Redux and React Router. Just use React Router directly.\n\n## Please check out [the differences between react-router-redux and redux-router](#differences-with-react-router-redux) before using this library\n\n[Redux](redux.js.org) bindings for [React Router](https://github.com/reactjs/react-router).\n\n- Keep your router state inside your Redux Store.\n- Interact with the Router with the same API you use to interact with the rest of your app state.\n- Completely interoperable with existing React Router API. `\u003cLink /\u003e`, `router.transitionTo()`, etc. still work.\n- Serialize and deserialize router state.\n- Works with time travel feature of Redux Devtools!\n\n```sh\n# installs version 2.x.x\nnpm install --save redux-router\n```\nInstall the version 1.0.0 via the `previous` tag\n```sh\nnpm install --save redux-router@previous\n```\n\n\n## Why\n\nReact Router is a fantastic routing library, but one downside is that it abstracts away a very crucial piece of application state — the current route! This abstraction is super useful for route matching and rendering, but the API for interacting with the router to 1) trigger transitions and 2) react to state changes within the component lifecycle leaves something to be desired.\n\nIt turns out we already solved these problems with Flux (and Redux): We use action creators to trigger state changes, and we use higher-order components to subscribe to state changes.\n\nThis library allows you to keep your router state **inside your Redux store**. So getting the current pathname, query, and params is as easy as selecting any other part of your application state.\n\n## Example\n\n```js\nimport React from 'react';\nimport { combineReducers, applyMiddleware, compose, createStore } from 'redux';\nimport { reduxReactRouter, routerStateReducer, ReduxRouter } from 'redux-router';\nimport { createHistory } from 'history';\nimport { Route } from 'react-router';\n\n// Configure routes like normal\nconst routes = (\n  \u003cRoute path=\"/\" component={App}\u003e\n    \u003cRoute path=\"parent\" component={Parent}\u003e\n      \u003cRoute path=\"child\" component={Child} /\u003e\n      \u003cRoute path=\"child/:id\" component={Child} /\u003e\n    \u003c/Route\u003e\n  \u003c/Route\u003e\n);\n\n// Configure reducer to store state at state.router\n// You can store it elsewhere by specifying a custom `routerStateSelector`\n// in the store enhancer below\nconst reducer = combineReducers({\n  router: routerStateReducer,\n  //app: rootReducer, //you can combine all your other reducers under a single namespace like so\n});\n\n// Compose reduxReactRouter with other store enhancers\nconst store = compose(\n  applyMiddleware(m1, m2, m3),\n  reduxReactRouter({\n    routes,\n    createHistory\n  }),\n  devTools()\n)(createStore)(reducer);\n\n\n// Elsewhere, in a component module...\nimport { connect } from 'react-redux';\nimport { push } from 'redux-router';\n\nconnect(\n  // Use a selector to subscribe to state\n  state =\u003e ({ q: state.router.location.query.q }),\n\n  // Use an action creator for navigation\n  { push }\n)(SearchBox);\n```\n\nYou will find a **server-rendering** example in the repo´s example directory.\n\n### Works with Redux Devtools (and other external state changes)\n\nredux-router will notice if the router state in your Redux store changes from an external source other than the router itself — e.g. the Redux Devtools — and trigger a transition accordingly!\n\n## Differences with react-router-redux\n\n#### react-router-redux\n\n[react-router-redux](https://github.com/reactjs/react-router-redux) (formerly redux-simple-router) takes a different approach to\nintegrating routing with redux. react-router-redux lets React Router do all the heavy lifting and syncs the url data to a history\n[location](https://github.com/mjackson/history/blob/master/docs/Location.md#location) object in the store. This means that users can use\nReact Router's APIs directly and benefit from the wide array of documentation and examples there.\n\nThe README for react-router-redux has a useful picture included here:\n\n[redux](https://github.com/reactjs/redux) (`store.routing`) \u0026nbsp;\u0026harr;\u0026nbsp; [**react-router-redux**](https://github.com/reactjs/react-router-redux) \u0026nbsp;\u0026harr;\u0026nbsp; [history](https://github.com/reactjs/history) (`history.location`) \u0026nbsp;\u0026harr;\u0026nbsp; [react-router](https://github.com/reactjs/react-router)\n\nThis approach, while simple to use, comes with a few caveats:\n  1. The history location object does not include React Router params and they must be either passed down from a React Router component or recomputed.\n  2. It is discouraged (and dangerous) to connect the store data to a component because the store data potentially updates **after** the React Router properties have changed, therefore there can be race conditions where the location store data differs from the location object passed down via React Router to components.\n\nreact-router-redux encourages users to use props directly from React Router in the components (they are passed down to any rendered route components). This means that if you want to access the location data far down the component tree, you may need to pass it down or use React's context feature.\n\n#### redux-router\n\nThis project, on the other hand takes the approach of storing the **entire** React Router data inside the redux store. This has the main benefit that it becomes impossible for the properties passed down by redux-router to the components in the Route to differ from the data included in the store. Therefore feel free to connect the router data to any component you wish. You can also access the route params from the store directly. redux-router also provides an API for hot swapping the routes from the Router (something React Router does not currently provide).\n\nThe picture of redux-router would look more like this:\n\n[redux](https://github.com/reactjs/redux) (`store.router`) \u0026nbsp;\u0026harr;\u0026nbsp; [**redux-router**](https://github.com/acdlite/redux-router) \u0026nbsp;\u0026harr;\u0026nbsp; [react-router (via RouterContext)](https://github.com/reactjs/react-router)\n\nThis approach, also has its set of limitations:\n  1. The router data is not all serializable (because Components and functions are not direclty serializable) and therefore this can cause issues with some devTools extensions and libraries that help in saving the store to the browser session. This can be mitigated if the libraries offer ways to ignore seriliazing parts of the store but is not always possible.\n  2. redux-router takes advantage of the RouterContext to still use much of React Router's internal logic. However, redux-router must still implement many things that React Router already does on its own and can cause delays in upgrade paths.\n  3. redux-router must provide a slightly different top level API (due to 2) even if the Route logic/matching is identical\n\n\nUltimately, your choice in the library is up to you and your project's needs. react-router-redux will continue to have a larger support\nin the community due to its inclusion into the reactjs github organization and visibility. **react-router-redux is the recommended approach**\nfor react-router and redux integration. However, you may find that redux-router aligns better with your project's needs.\nredux-router will continue to be mantained as long as demand exists.\n\n## API\n\n### `reduxReactRouter({ routes, createHistory, routerStateSelector })`\n\nA Redux store enhancer that adds router state to the store.\n\n### `routerStateReducer(state, action)`\n\nA reducer that keeps track of Router state.\n\n### `\u003cReduxRouter\u003e`\n\nA component that renders a React Router app using router state from a Redux store.\n\n### `push(location)`\n\nAn action creator for `history.push()`. [mjackson/history/docs/GettingStarted.md#navigation](https://github.com/mjackson/history/blob/master/docs/GettingStarted.md#navigation)\n\nBasic example (let say we are at `http://example.com/orders/new`):\n```js\ndispatch(push('/orders/' + order.id));\n```\nProvided that `order.id` is set and equals `123` it will change browser address bar to `http://example.com/orders/123` and appends this URL to the browser history (without reloading the page).\n\nA bit more advanced example:\n```js\ndispatch(push({\n  pathname: '/orders',\n  query: { filter: 'shipping' }\n}));\n```\nThis will change the browser address bar to `http://example.com/orders?filter=shipping`.\n\n**NOTE:** clicking back button will change address bar back to `http://example.com/orders/new` but will **not** change page content\n\n### `replace(location)`\n\nAn action creator for `history.replace()`. [mjackson/history/docs/GettingStarted.md#navigation](https://github.com/mjackson/history/blob/master/docs/GettingStarted.md#navigation)\n\nWorks similar to the `push` except that it doesn't create new browser history entry.\n\n**NOTE:** Referring to the `push` example: clicking back button will change address bar back to the URL before `http://example.com/orders/new` and will change page content.\n\n### `go(n)` `goBack()` `goForward()`\n\n```js\n// Go back to the previous entry in browser history.\n// These lines are synonymous.\nhistory.go(-1);\nhistory.goBack();\n\n// Go forward to the next entry in browser history.\n// These lines are synonymous.\nhistory.go(1);\nhistory.goForward();\n```\n\n## Handling authentication via a higher order component\n\n@joshgeller threw together a good example on how to handle user authentication via a higher order component. Check out [joshgeller/react-redux-jwt-auth-example](https://github.com/joshgeller/react-redux-jwt-auth-example)\n\n## Bonus: Reacting to state changes with redux-rx\n\nThis library pairs well with [redux-rx](https://github.com/acdlite/redux-rx) to trigger route transitions in response to state changes. Here's a simple example of redirecting to a new page after a successful login:\n\n```js\nconst LoginPage = createConnector(props$, state$, dispatch$, () =\u003e {\n  const actionCreators$ = bindActionCreators(actionCreators, dispatch$);\n  const push$ = actionCreators$.map(ac =\u003e ac.push);\n\n  // Detect logins\n  const didLogin$ = state$\n    .distinctUntilChanged(state =\u003e state.loggedIn)\n    .filter(state =\u003e state.loggedIn);\n\n  // Redirect on login!\n  const redirect$ = didLogin$\n    .withLatestFrom(\n      push$,\n      // Use query parameter as redirect path\n      (state, push) =\u003e () =\u003e push(state.router.query.redirect || '/')\n    )\n    .do(go =\u003e go());\n\n  return combineLatest(\n    props$, actionCreators$, redirect$,\n    (props, actionCreators) =\u003e ({\n      ...props,\n      ...actionCreators\n    });\n});\n```\n\nA more complete example is forthcoming.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facdlite%2Fredux-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facdlite%2Fredux-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facdlite%2Fredux-router/lists"}