{"action":"closed","issue":{"url":"https://api.github.com/repos/rackt/react-router/issues/2474","labels_url":"https://api.github.com/repos/rackt/react-router/issues/2474/labels{/name}","comments_url":"https://api.github.com/repos/rackt/react-router/issues/2474/comments","events_url":"https://api.github.com/repos/rackt/react-router/issues/2474/events","html_url":"https://github.com/rackt/react-router/issues/2474","id":115138530,"number":2474,"title":"Passing multiple components to route results in Invariant Violation error","user":{"login":"shankiesan","id":2608862,"avatar_url":"https://avatars.githubusercontent.com/u/2608862?v=3","gravatar_id":"","url":"https://api.github.com/users/shankiesan","html_url":"https://github.com/shankiesan","followers_url":"https://api.github.com/users/shankiesan/followers","following_url":"https://api.github.com/users/shankiesan/following{/other_user}","gists_url":"https://api.github.com/users/shankiesan/gists{/gist_id}","starred_url":"https://api.github.com/users/shankiesan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shankiesan/subscriptions","organizations_url":"https://api.github.com/users/shankiesan/orgs","repos_url":"https://api.github.com/users/shankiesan/repos","events_url":"https://api.github.com/users/shankiesan/events{/privacy}","received_events_url":"https://api.github.com/users/shankiesan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-04T20:19:39Z","updated_at":"2015-11-04T20:42:24Z","closed_at":"2015-11-04T20:42:24Z","body":"I've posted the [following on StackOverflow](http://stackoverflow.com/questions/33531173/react-router-passing-multiple-components-results-in-invariant-violation-error). I think it's more likely to be an implementation problem than a bug, but I thought I'd drop it here in case anyone has any thoughts.\r\n\r\nIf it's definitely not a bug (and is a problem with my code), let's close the issue! If I get a solution on SO, I'll link to it here.\r\n\r\n-----\r\n\r\nI'm building an app with a sidebar. Originally, that sidebar was static (no problem), but now I want it to dynamically update based on the route using React Router.\r\n\r\nIt's very similar to the [sidebar](https://github.com/rackt/react-router/blob/master/examples/sidebar/app.js) example provided as part of the documentation, so I set about retrofitting the sidebar example to my existing app.\r\n\r\nHere's router code passing the route a single component:\r\n\r\n    import React from 'react';\r\n    import ReactRouter from \"react-router\";\r\n    import {Router} from 'react-router';\r\n    import {Route} from 'react-router';\r\n    import Main from \"./Main\"\r\n    import ItemPanel from \"../views/ItemPanel\"\r\n\r\n    var routes = (\r\n      <Router>\r\n        <Route path=\"/\" component={Main}>\r\n          <Route path=\":category\" component={ItemPanel}/>\r\n        </Route>\r\n      </Router>\r\n    );\r\n\r\nThis works, in the sense that it doesn't throw an error; however, to make the app work as it does in the example (this [line](https://github.com/rackt/react-router/blob/4e48b6bab1efedb9b9cc03402ff15c9554a8955f/examples/sidebar/app.js#L113) in particular), we need to give it a prop of `components` (instead of `component`) so that `Main` has access to `this.props.itemPanel`. So, substituting the `:category` path for:\r\n\r\n    <Route path=\":category\" components={{itemPanel: ItemPanel}}/>\r\n\r\nand I get an error:\r\n\r\n    Error: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.\r\n\r\nObviously it getting `undefined` is a problem, but I can't work\r\nI don't *think* that the problem is in my `ItemPanel` code as I've tried swapping out `ItemPanel` for `Test`, where `Test` is the most basic possible React component. Same problem.\r\n\r\nIf it makes any difference, this is an isomorphic app and the error happens both on the client and on the server when trying to show this route.\r\n\r\nOriginally I thought that it might be a problem of mixing ES5 and ES6 syntax, but I've tried rewriting `ItemPanel` in ES6 and have the exact same problem. Other parts of my application still use ES5, but I can't see how that would be an issue here if they're not imported directly.\r\n\r\nThanks in advance!"}}