{"action":"opened","issue":{"url":"https://api.github.com/repos/deepstreamIO/golden-layout/issues/86","repository_url":"https://api.github.com/repos/deepstreamIO/golden-layout","labels_url":"https://api.github.com/repos/deepstreamIO/golden-layout/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/deepstreamIO/golden-layout/issues/86/comments","events_url":"https://api.github.com/repos/deepstreamIO/golden-layout/issues/86/events","html_url":"https://github.com/deepstreamIO/golden-layout/issues/86","id":147857761,"number":86,"title":"Usage with @connect breaks in various ways.","user":{"login":"noah79","id":2080870,"avatar_url":"https://avatars.githubusercontent.com/u/2080870?v=3","gravatar_id":"","url":"https://api.github.com/users/noah79","html_url":"https://github.com/noah79","followers_url":"https://api.github.com/users/noah79/followers","following_url":"https://api.github.com/users/noah79/following{/other_user}","gists_url":"https://api.github.com/users/noah79/gists{/gist_id}","starred_url":"https://api.github.com/users/noah79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noah79/subscriptions","organizations_url":"https://api.github.com/users/noah79/orgs","repos_url":"https://api.github.com/users/noah79/repos","events_url":"https://api.github.com/users/noah79/events{/privacy}","received_events_url":"https://api.github.com/users/noah79/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-12T20:00:34Z","updated_at":"2016-04-12T20:00:34Z","closed_at":null,"body":"Rendering any React components that use react-redux and the HOC @connect causes golden-layout to fail to render with an error along the lines of:\r\n\"Uncaught Invariant Violation: Could not find \"store\" in either the context or props of \"Connect(DropdownMenu)\". Either wrap the root component in a <Provider>, or explicitly pass \"store\" as a prop to \"Connect(DropdownMenu)\".\r\n\r\nOur extremely kludgy \"fix\" is to manually copy the store across to context like so:\r\n``` \r\n   static contextTypes : React.ValidationMap<any> = {\r\n        store: React.PropTypes.shape({\r\n            subscribe: React.PropTypes.func.isRequired,\r\n            dispatch: React.PropTypes.func.isRequired,\r\n            getState: React.PropTypes.func.isRequired\r\n        })\r\n    }\r\n\r\n    content.props = {store: (this.context as any).store};\r\n```\r\n\r\nand then later in our component to be rendered:\r\n```\r\n   static childContextTypes : React.ValidationMap<any> = {\r\n        store: React.PropTypes.shape({\r\n            subscribe: React.PropTypes.func.isRequired,\r\n            dispatch: React.PropTypes.func.isRequired,\r\n            getState: React.PropTypes.func.isRequired\r\n        })\r\n    }\r\n\r\n    getChildContext() {\r\n        return {store: this.props.store}\r\n    }\r\n```\r\n\r\nWhile this solves the nominal case, as soon as I try to pop out a component, I am back in a world without my store:\r\n\r\n```\r\n:8060/dist/vendor.js:3324 Warning: Failed Context Types: Required child context `store.subscribe` was not specified in `TestItem`.warning @ :8060/dist/vendor.js:3324\r\n:8060/dist/vendor.js:3324 Warning: Failed Context Types: Required context `store.subscribe` was not specified in `Connect(DropdownMenu)`. Check the render method of `QueryViewToolbar`.warning @ :8060/dist/vendor.js:3324\r\n:8060/dist/vendor.js:37303 Uncaught TypeError: _this.store.getState is not a function\r\n```\r\n\r\nHalp!"}}