{"_id":"@atfarm/connected-react-router","_rev":"3-2ea995bd05eb1c38a716768ccd3c4899","name":"@atfarm/connected-react-router","dist-tags":{"latest":"4.3.0"},"versions":{"4.3.0":{"name":"@atfarm/connected-react-router","version":"4.3.0","description":"A Redux binding for React Router v4","main":"lib/index.js","types":"./index.d.ts","author":{"name":"Supasate Choochaisri"},"license":"MIT","files":["*.md","*.js","*.ts","lib","umd"],"scripts":{"build:commonjs":"BABEL_ENV=commonjs babel src --out-dir lib","build:umd":"NODE_ENV=development webpack src/index.js umd/ConnectedReactRouter.js","build:umd:min":"NODE_ENV=production webpack -p src/index.js umd/ConnectedReactRouter.min.js","build":"npm run build:commonjs & npm run build:umd & npm run build:umd:min","lint":"eslint .","test":"jest --config ./.jestrc","test:watch":"npm run test -- --watch","posttest":"npm run lint"},"dependencies":{"immutable":"^3.8.1","react-router":"^4.2.0"},"peerDependencies":{"react":"^15.5.4 || ^16.0.0","react-redux":"^4.4.8 || ^5.0.7","redux":"^3.6.0 || ^4.0.0"},"devDependencies":{"@types/history":"^4.5.0","@types/react":"^15.0.23","babel-cli":"^6.18.0","babel-core":"^6.20.0","babel-eslint":"^7.1.1","babel-jest":"^17.0.2","babel-loader":"^6.3.1","babel-plugin-rewire":"^1.0.0","babel-preset-es2015":"^6.18.0","babel-preset-react":"^6.16.0","babel-preset-stage-1":"^6.16.0","babel-template":"^6.2.0","babel-types":"^6.2.0","enzyme":"3.1.1","enzyme-adapter-react-16":"^1.0.4","eslint":"^3.12.0","eslint-plugin-import":"^2.2.0","eslint-plugin-react":"^6.8.0","jest":"^17.0.2","prop-types":"^15.5.8","raf":"^3.4.0","react":"^16.0.0","react-dom":"^16.0.0","react-redux":"^5.0.7","react-test-renderer":"^16.0.0","redux":"^4.0.0","redux-devtools":"^3.4.0","redux-immutable":"^3.0.11","redux-mock-store":"^1.2.1","rewire":"^2.5.2","webpack":"^2.2.1"},"repository":{"type":"git","url":"git+https://github.com/supasate/connected-react-router.git"},"bugs":{"url":"https://github.com/supasate/connected-react-router/issues"},"gitHead":"2243a1cc8b91fd226a1ab33d5368448d3a8f92b6","homepage":"https://github.com/supasate/connected-react-router#readme","_id":"@atfarm/connected-react-router@4.3.0","_npmVersion":"6.2.0","_nodeVersion":"8.11.3","_npmUser":{"name":"franciscolourenco","email":"admin@at.farm"},"dist":{"integrity":"sha512-VAffH4WLmifTjXJz0EE3tFZUaPVAeIg6SUFCdRUaqzJAOP9G5CrGnJmpiuWnXWqVlIbUlH5O3mkUlzBgl37VaQ==","shasum":"41da137411c38ad83a8b42884c2e5ed022e971de","tarball":"https://registry.npmjs.org/@atfarm/connected-react-router/-/connected-react-router-4.3.0.tgz","fileCount":23,"unpackedSize":565418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWCyJCRA9TVsSAnZWagAAuewP+wZYncD4V9JDi0oIiLem\nV0BFBuH8KxFo+Ypni8bhDhnR3THDhbUfJP5rIIeHqSvOqCtH3Cr5MWZxg/ft\n5qcgR5X+b298SXMcKUCdjviIwnyNieDvfJSFBjBUmHP6SCbLmoWlSyd//49F\n+f7GrXYQ9BXgXUyx+8qHdZ2TO2gMicTWG8pqyP856GljXCgOGhw4qnmCPwcb\nGd1TEGbS2l9QqT6GaAWT8boTybZeYrq6dntlu5vLwEzy+GETHvzRRc+Sh5Sa\n2IlleLMNI2tVbHmkRohXkgP/g7dv7fK2Ai9MZ2eQ1enaxYzAF6i8lprApZTv\nN19BrPZLJlwnkjg49Mm4MRdPs2I8aXIj/lQi7elIQsYnL60sFnVB7XAAbUzt\nHg0jFIwyBd0iQodXTV7DrhMEV+MP2Yw81hTZPiD77fxne8o9ENUmHAQ65KIl\ntmS5a3aKnrgH3XFUUslnyvqUyA5x3LABHKDuqKQqdOyFhogVMrLnSZyjkcxV\nDPBKOCu6BnhESFiycfScY8amyPCj6KDao9zP3ODgQcvqI3iy9LQ7kWq07FuS\nuFFJlhZRAsvDZBzr+5KiFRYeX0e1/bwYuQdxke+hssveisRZBXpVd2n8ChYI\nafUIceAlOdd2gRcYhNFtOZ021S05cHS1QYxbdLOetu5tKyYKen6ACflVg82B\n08lv\r\n=/Xne\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZ3D5Ig+WPWVWW8yZgUZL96l9gUrY686FZM7p6ryo92AIhAIoyu3FbDM2r/Cac3MHYCeZGK2X0zJrK8JY6Pgmf6w69"}]},"maintainers":[{"name":"franciscolourenco","email":"admin@at.farm"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/connected-react-router_4.3.0_1532505225080_0.8592841650014933"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-25T07:53:44.852Z","4.3.0":"2018-07-25T07:53:45.244Z","modified":"2022-04-04T16:03:36.059Z"},"maintainers":[{"email":"mr.sascha.krause@gmail.com","name":"saschakrause"},{"email":"philipp.rottner@yara.com","name":"p.r.yara"},{"email":"aristidesfl@gmail.com","name":"franciscolourenco"}],"description":"A Redux binding for React Router v4","homepage":"https://github.com/supasate/connected-react-router#readme","repository":{"type":"git","url":"git+https://github.com/supasate/connected-react-router.git"},"author":{"name":"Supasate Choochaisri"},"bugs":{"url":"https://github.com/supasate/connected-react-router/issues"},"license":"MIT","readme":"Connected React Router [![Build Status](https://travis-ci.org/supasate/connected-react-router.svg?branch=master)](https://travis-ci.org/supasate/connected-react-router) [![Open Source Helpers](https://www.codetriage.com/supasate/connected-react-router/badges/users.svg)](https://www.codetriage.com/supasate/connected-react-router)\n======================\nA Redux binding for React Router v4\n\nMain features\n-------------\n:sparkles: Synchronize router state with redux store with uni-directional flow (history -> store -> router -> components).\n\n:gift: Support [React Router v4](https://github.com/ReactTraining/react-router/tree/v4).\n\n:sunny: Support functional component hot reloading while preserving state (with [react-hot-reload v3](https://github.com/gaearon/react-hot-loader/tree/next)).\n\n:tada: Dispatching history methods (`push`, `replace`, `go`, `goBack`, `goForward`) work for both [redux-thunk](https://github.com/gaearon/redux-thunk) and [redux-saga](https://github.com/yelouafi/redux-saga).\n\n:snowman: Nested children can access routing state such as current location directly with `react-redux`'s `connect`.\n\n:clock9: Support time traveling in Redux DevTools.\n\n:gem: Support [Immutable.js](https://facebook.github.io/immutable-js/)\n\n:muscle: Support TypeScript\n\n\nInstallation\n-----------\nUsing [npm](https://www.npmjs.com/):\n\n    $ npm install --save connected-react-router\n\nOr [yarn](https://yarnpkg.com/):\n\n    $ yarn add connected-react-router\n\nUsage\n-----\n### Step 1\n\n- Create a `history` object.\n- Wrap the root reducer with `connectRouter` and supply the `history` object to get a new root reducer.\n- Use `routerMiddleware(history)` if you want to dispatch history actions (ex. to change URL with `push('/path/to/somewhere')`).\n\n\n```js\n...\nimport { createBrowserHistory } from 'history'\nimport { applyMiddleware, compose, createStore } from 'redux'\nimport { connectRouter, routerMiddleware } from 'connected-react-router'\n...\nconst history = createBrowserHistory()\n\nconst store = createStore(\n  connectRouter(history)(rootReducer), // new root reducer with router state\n  initialState,\n  compose(\n    applyMiddleware(\n      routerMiddleware(history), // for dispatching history actions\n      // ... other middlewares ...\n    ),\n  ),\n)\n```\n\n### Step 2\n\n\n- Wrap your react-router v4 routing with `ConnectedRouter` and pass `history` object as a prop.\n- Place `ConnectedRouter` as children of `react-redux`'s `Provider`.\n\n```js\n...\nimport { Provider } from 'react-redux'\nimport { Route, Switch } from 'react-router' // react-router v4\nimport { ConnectedRouter } from 'connected-react-router'\n...\nReactDOM.render(\n  <Provider store={store}>\n    <ConnectedRouter history={history}> { /* place ConnectedRouter under Provider */ }\n      <div> { /* your usual react-router v4 routing */ }\n        <Switch>\n          <Route exact path=\"/\" render={() => (<div>Match</div>)} />\n          <Route render={() => (<div>Miss</div>)} />\n        </Switch>\n      </div>\n    </ConnectedRouter>\n  </Provider>,\n  document.getElementById('react-root')\n)\n```\nNow, it's ready to work!\n\n\nExamples\n--------\nSee [examples](https://github.com/supasate/connected-react-router/tree/master/examples) folder\n\n[FAQ](https://github.com/supasate/connected-react-router/tree/master/FAQ.md)\n-----\n- [How to navigate with Redux action](https://github.com/supasate/connected-react-router/tree/master/FAQ.md#how-to-navigate-with-redux-action)\n- [How to get current browser location (URL)](https://github.com/supasate/connected-react-router/tree/master/FAQ.md#how-to-get-current-browser-location-url)\n- [How to set Router props e.g. basename, initialEntries, etc.](https://github.com/supasate/connected-react-router/tree/master/FAQ.md#how-to-set-router-props-eg-basename-initialentries-etc)\n- [How to hot reload functional components](https://github.com/supasate/connected-react-router/tree/master/FAQ.md#how-to-hot-reload-functional-components)\n- [How to hot reload reducers](https://github.com/supasate/connected-react-router/tree/master/FAQ.md#how-to-hot-reload-reducers)\n- [How to support Immutable.js](https://github.com/supasate/connected-react-router/tree/master/FAQ.md#how-to-support-immutablejs)\n\nBuild\n-----\n```bash\nnpm run build\n```\nGenerated files will be in `lib` folder.\n\nContributors\n------------\nSee [Contributors](https://github.com/supasate/connected-react-router/graphs/contributors) and [Acknowledge](https://github.com/supasate/connected-react-router/blob/master/ACKNOWLEDGE.md).\n\nLicense\n-------\n[MIT License](https://github.com/supasate/connected-react-router/blob/master/LICENSE.md)\n","readmeFilename":"README.md"}