{"action":"created","issue":{"url":"https://api.github.com/repos/ReactTraining/react-router/issues/5736","repository_url":"https://api.github.com/repos/ReactTraining/react-router","labels_url":"https://api.github.com/repos/ReactTraining/react-router/issues/5736/labels{/name}","comments_url":"https://api.github.com/repos/ReactTraining/react-router/issues/5736/comments","events_url":"https://api.github.com/repos/ReactTraining/react-router/issues/5736/events","html_url":"https://github.com/ReactTraining/react-router/issues/5736","id":274922817,"number":5736,"title":"<ConnectedRouter> Not working with non-standard react-redux <Provider>","user":{"login":"TSMMark","id":4197823,"avatar_url":"https://avatars1.githubusercontent.com/u/4197823?v=4","gravatar_id":"","url":"https://api.github.com/users/TSMMark","html_url":"https://github.com/TSMMark","followers_url":"https://api.github.com/users/TSMMark/followers","following_url":"https://api.github.com/users/TSMMark/following{/other_user}","gists_url":"https://api.github.com/users/TSMMark/gists{/gist_id}","starred_url":"https://api.github.com/users/TSMMark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TSMMark/subscriptions","organizations_url":"https://api.github.com/users/TSMMark/orgs","repos_url":"https://api.github.com/users/TSMMark/repos","events_url":"https://api.github.com/users/TSMMark/events{/privacy}","received_events_url":"https://api.github.com/users/TSMMark/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-11-17T16:34:06Z","updated_at":"2017-11-28T05:18:56Z","closed_at":"2017-11-17T17:08:41Z","author_association":"NONE","body":"`<ConnectedRouter>` Not working with non-standard react-redux `<Provider>`, specifically for me `<ApolloProvider>` from react-apollo.\r\n\r\nI wouldn't mind submitting a PR if someone point me in the right direction.\r\n\r\n## Version\r\n4.2.0\r\n\r\n## Steps to reproduce\r\n```js\r\nimport { ApolloProvider } from 'react-apollo'\r\n\r\n<ApolloProvider\r\n  client={client}\r\n  store={store}\r\n>\r\n  <ConnectedRouter history={history}>\r\n```\r\n\r\n## Expected Behavior\r\nConnectedRouter should be able to find parent `<ApolloProvider>` instead of only a `<Provider>`.\r\n\r\n## Actual Behavior\r\nJS Crash and nothing works.\r\n\r\n`_this.store` is `undefined` in ConnectedRouter here:\r\n\r\n```js\r\nfunction ConnectedRouter() {\r\n    var _temp, _this, _ret;\r\n\r\n    _classCallCheck(this, ConnectedRouter);\r\n\r\n    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\r\n      args[_key] = arguments[_key];\r\n    }\r\n\r\n    return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.handleLocationChange = function (location) {\r\n      _this.store.dispatch({ // HERE\r\n        type: _reducer.LOCATION_CHANGE,\r\n        payload: location\r\n      });\r\n    }, _temp), _possibleConstructorReturn(_this, _ret);\r\n  }\r\n```\r\n\r\n```\r\nUncaught TypeError: Cannot read property 'dispatch' of undefined\r\n    at ConnectedRouter._this.handleLocationChange (eval at <anonymous> (dashboard_2.70b191588b577ba24fda.js:617), <anonymous>:38:19)\r\n    at ConnectedRouter.componentWillMount (eval at <anonymous> (dashboard_2.70b191588b577ba24fda.js:617), <anonymous>:51:10)\r\n    at callComponentWillMount (eval at <anonymous> (dashboard_2.70b191588b577ba24fda.js:746), <anonymous>:6357:14)\r\n    at mountClassInstance (eval at <anonymous> (dashboard_2.70b191588b577ba24fda.js:746), <anonymous>:6413:7)\r\n    at updateClassComponent (eval at <anonymous> (dashboard_2.70b191588b577ba24fda.js:746), <anonymous>:7869:9)\r\n    at beginWork (eval at <anonymous> (dashboard_2.70b191588b577ba24fda.js:746), <anonymous>:8253:16)\r\n    at performUnitOfWork (eval at <anonymous> (dashboard_2.70b191588b577ba24fda.js:746), <anonymous>:10244:16)\r\n    at workLoop (eval at <anonymous> (dashboard_2.70b191588b577ba24fda.js:746), <anonymous>:10308:26)\r\n    at HTMLUnknownElement.callCallback (eval at <anonymous> (dashboard_2.70b191588b577ba24fda.js:746), <anonymous>:540:14)\r\n    at Object.invokeGuardedCallbackDev (eval at <anonymous> (dashboard_2.70b191588b577ba24fda.js:746), <anonymous>:579:16)\r\n\r\nConnectedRouter._this.handleLocationChange | @ | ConnectedRouter.js?e9f6:38\r\n-- | -- | --\r\n  | componentWillMount | @ | ConnectedRouter.js?e9f6:51\r\n  | callComponentWillMount | @ | react-dom.development.js?6fb0:6357\r\n  | mountClassInstance | @ | react-dom.development.js?6fb0:6413\r\n  | updateClassComponent | @ | react-dom.development.js?6fb0:7869\r\n  | beginWork | @ | react-dom.development.js?6fb0:8253\r\n  | performUnitOfWork | @ | react-dom.development.js?6fb0:10244\r\n  | workLoop | @ | react-dom.development.js?6fb0:10308\r\n  | callCallback | @ | react-dom.development.js?6fb0:540\r\n  | invokeGuardedCallbackDev | @ | react-dom.development.js?6fb0:579\r\n  | invokeGuardedCallback | @ | react-dom.development.js?6fb0:436\r\n  | renderRoot | @ | react-dom.development.js?6fb0:10386\r\n  | performWorkOnRoot | @ | react-dom.development.js?6fb0:11000\r\n  | performWork | @ | react-dom.development.js?6fb0:10952\r\n  | requestWork | @ | react-dom.development.js?6fb0:10861\r\n  | scheduleWorkImpl | @ | react-dom.development.js?6fb0:10744\r\n  | scheduleWork | @ | react-dom.development.js?6fb0:10706\r\n  | scheduleTopLevelUpdate | @ | react-dom.development.js?6fb0:11177\r\n  | updateContainer | @ | react-dom.development.js?6fb0:11215\r\n  | (anonymous) | @ | react-dom.development.js?6fb0:15232\r\n  | unbatchedUpdates | @ | react-dom.development.js?6fb0:11086\r\n  | renderSubtreeIntoContainer | @ | react-dom.development.js?6fb0:15231\r\n  | render | @ | react-dom.development.js?6fb0:15296\r\n  | (anonymous) | @ | dashboard_2.js?f16b:38\r\n  | ready | @ | document-ready.js?3445:24\r\n\r\nThe above error occurred in the <ConnectedRouter> component:\r\n    in ConnectedRouter\r\n    in QueryRecyclerProvider (created by ApolloProvider)\r\n    in ApolloProvider\r\n```"},"comment":{"url":"https://api.github.com/repos/ReactTraining/react-router/issues/comments/347416590","html_url":"https://github.com/ReactTraining/react-router/issues/5736#issuecomment-347416590","issue_url":"https://api.github.com/repos/ReactTraining/react-router/issues/5736","id":347416590,"user":{"login":"esetnik","id":664434,"avatar_url":"https://avatars1.githubusercontent.com/u/664434?v=4","gravatar_id":"","url":"https://api.github.com/users/esetnik","html_url":"https://github.com/esetnik","followers_url":"https://api.github.com/users/esetnik/followers","following_url":"https://api.github.com/users/esetnik/following{/other_user}","gists_url":"https://api.github.com/users/esetnik/gists{/gist_id}","starred_url":"https://api.github.com/users/esetnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esetnik/subscriptions","organizations_url":"https://api.github.com/users/esetnik/orgs","repos_url":"https://api.github.com/users/esetnik/repos","events_url":"https://api.github.com/users/esetnik/events{/privacy}","received_events_url":"https://api.github.com/users/esetnik/received_events","type":"User","site_admin":false},"created_at":"2017-11-28T05:18:55Z","updated_at":"2017-11-28T05:18:55Z","author_association":"NONE","body":"I was hit by the same issue as @TSMMark. I'm going to file a bug in https://github.com/apollographql/react-apollo because the documentation clearly states to pass a store prop but @timdorr is right that this doesn't actually seem to be implemented."}}
{"actor":{"display_login":"esetnik"}}